当前位置: 移动技术网 > IT编程>开发语言>JavaScript > html当中如何引用js文件

html当中如何引用js文件

2019年10月06日  | 移动技术网IT编程  | 我要评论
3)html当中如何引用js文件如果需要javascript工程师和html美工各干各的工作,需要分开写文件。例 1.2<html><head> <script src="Hello.js"></script> <title></title></head><body></body></html>He ...

 

3)html当中如何引用js文件

如果需要javascript工程师和html美工各干各的工作,需要分开写文件。

例 1.2


<html>
<head>
    <script src="hello.js"></script>
    <title></title>
</head>
<body>
</body>
</html>



hello.js(如果你用notepad建立一个txt之后你再改为js,一定在存时,要存成utf-8或unicode格式):

    var a ;
    /*before you set value, a' type can not be defined.*/
    document.writeln(typeof(a) + "<br>他们");
    a = true;
    document.writeln(typeof(a) + "<br>");
    /*下面的console.log只有安装了firebug的firebox不报错*/
    console.log("this is the 1 message 马克-to-win write in %s", a);
    document.writeln(a);

文章转载自原文:

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网