引用js_html当中如何引用js文件

马克- to-win:马克 java社区:防盗版实名手机尾号:73203。马克-to-win:如果需要javascript工程师和html美工各干各的工作,需要分开写文件。例 1.2        Hello.js(如果你用notepad建立一个txt之后你再改为js,一定在存时,要存成utf-8或unicode格式):    var a ;    /*before you set value, a' type can not be defined.*/    document.writeln(typeof(a) + "
他们");    a = true;    document.writeln(typeof(a) + "
");    /*下面的console.log只有安装了firebug的firebox不报错*/    console.log("This is the 1 message 马克-to-win write in %s", a);    document.writeln(a);

2.简单语法: 例 2.1    var i = 0;    do    {        i += 1;        window.document.write("i=" + i + "
");    }    while (i < 3)我们输出结果:i=1i=2i=3我们

例 2.2/span>        "http://www.w3.org/TR/html4/loose.dtd">                var i = 5;        while (i > 0) {            window.document.write("i is" + i + "
");            i--;        }    输出结果:i is5i is4i is3i is2i is1例 2.3(自动转化,比如3            result = 0;        function qiuhe()        {            var num = window.document.getElementById("num").value;            /*the following typeof(num) is a string. can automatically convert string to number.*/            alert("typeof(num) is "+typeof(num));            for (var i = 1; i <= num; i++)            {                result = result+i;            }            window.document.getElementById("result").value = result;        }    1加到和是

由于篇幅关系, 阅读全文请点击左下角“阅读原文”

或者(以下链接必须打开一个新的浏览器,粘贴到地址栏才能工作):

http://www.mark-to-win.com/tutorial/js_1_htmIntroJs.html

百度中搜索“马克Java社区”到咱们官网上,可以找到所有的文章。

30602078c98f536df5c8a5ed955404aa.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值