本文摘自PHP中文网,作者coldplay.xixi,侵删。

免费学习推荐:js视频教程
javaScript-如何引入js代码
直接po代码和截图
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <!DOCTYPE html>
<html>
<head>
<meta charset= "UTF-8" >
<title>js01-如何引入js代码</title>
<script type= "text/javascript" >
document.write( "江西省赣州市于都县<br/>" );
console.log( "hello hi \n world " );
console.log( "tom ok\njack" );
console.log( "jerry<br/>ok" );
</script>
<script src= "hello.js" type= "text/javascript" ></script>
</head>
<body>
<h1>js01-如何引入js代码</h1>
<!--
如何引入js代码?
1.直接内嵌
2.引入外部的js文件
-->
<script type= "text/javascript" >
document.write( "我的老家在江西省赣州市于都县<br/>" );
</script>
<script src= "hello.js" type= "text/javascript" ></script>
</body>
</html>
|
hello.js文件
1 | document.write( "好好工作,努力赚钱!" );
|

相关免费学习推荐:javascript(视频)
以上就是javaScript介绍引入js代码的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
javascript的split()方法有什么用?
javascript如何实现将两个数组合并
javascript怎么修改html标签属性
javascript运行没有效果是怎么回事?
深入了解js中的原始类型(primitive type)
javascript居中怎么表示
javaweb与javascript区别是什么
javascript查看网页是否为伪静态的方法是什么
js中null是什么意思?
javascript怎么将字符串转int
更多相关阅读请进入《javascript》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » javaScript介绍引入js代码