js概述
-
js发展
js是互联网最流行的脚本语言,这门语言课用于web和xml,更广泛应用于服务器,pc端,移动端;
用法:
html中的脚本位于script标签之间
可放在head和body中 -
js引入
-
HTML内嵌JS
<head> <script> function hi() { alert("hello world"); } </script> </head>
- 引入外部的本地JS文件
<script type="text/javascript" src="attack.js"></script> //attack.js 代码 function attackEnemy() { document.write("land on"); alert("ready go"); }
- 引入网络上的JS文件
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
-