文章简介 <script>标签 参考文章1 js中,var 修饰变量名和不修饰的区别 <script>标签 type属性决定了这个标签是干嘛的,如text/javascript表示标签是个js脚本;text/html表示这个标签是个html页面,且是个模板供调用 1.js模版使用<script type="text/html"></script> 参考文章1 js中,var 修饰变量名和不修饰的区别 总结:全局变量可以不声明var 函数内变量必须声明var,在定义全局变量时加或不加var关键字没什么影响;但在定义局部变量时如果不加var关键字javascript解释程序会将其解释为全局变量。 参考文章1 参考文章2