雅典之夏的小站
知人者智 自知者明 Fighting!!

1、插入和包含
   1)   js,一般都放在head之间、注释的作用是当客户端浏览器版本过低时,不能识别而发生错误
<script language="JavaScript">
<!--
document.write(
"Hello World!");
//-->

</script>
 2)另外你也可以编辑.js文件,然后在页面里面直接引用就可以了
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>javascript</title><script language="javascript"src="Untitled-2.js"></script>
</head>


2、write
  在js中要显示字符,需要用document.write()的形式,writeln区别就是再write的基础上加入了换行

3、如例
document.write("Hello World!");
document.write("test"+document.lastModified);
document.bgColor = " black "
其中,document是对象,write是method,输出字符可以用加的形式,,可以在js里面设定页面的背景

4、提示框
   1)window.alert("testtesttest")
    弹出窗口
   2)window.confirm("test")
   3)有输入框的提示框
        window.prompt("test")
一不小心双击了标签了,写的全都没了!!!后面的不写了,写js时一定要注意“”   ’号的运用!

js的功能是超级强大的,运用还是要靠脑筋的,
posted on 2006-10-26 12:09 rkind 阅读(449) 评论(0)  编辑  收藏 所属分类: JSP&Servlet

只有注册用户登录后才能发表评论。


网站导航: