Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4742915
  • 博文数量: 206
  • 博客积分: 5240
  • 博客等级: 大校
  • 技术积分: 3224
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-12 21:40
文章分类

全部博文(206)

文章存档

2013年(13)

2012年(8)

2011年(33)

2010年(152)

我的朋友

分类:

2010-09-02 02:49:45

“Hello World!”程序 

//源程序 1.1

    <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
    "">
    <html>
    <head>
      <meta http-equiv=content-type content="text/html; charset=gb2312">
      <title>Sample Page!</title>
    </head>
    <body>
    <br>
    <center>
    <script language="javascript 1.2" type="text/javascript">
       document.write("Hello World!");
    </script>
    </center>
    </body>
    </html>


将上述代码保存为.html(或.html)文件并双击打开,系统调用默认浏览器解释执行,结果 
如图 1.6 所示

引入 JavaScript 脚本代码到 HTML 文档中  

    将JavaScript 脚本嵌入到HTML 文档中有4 种标准方法: 
     代码包含于标记对,然后嵌入到HTML 文档中; 
     通过
阅读(842) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~