本文共 423 字,大约阅读时间需要 1 分钟。
demo
function hello(){ alert("hello js1"); }hello(); // hello js2function hello(){ alert("hello js2"); }hello(); // hello js2
小结
1.js中可以允许重复的函数
2.函数式一块一块执行的以script作为块标记
3.同一个块中,如果有同名函数,以后一个为准
4.引入js文件也就是相对于一个大的script块
5.如果在页面底部执行js,相对于以最后一个函数作为执行函数
本文转自TBHacker博客园博客,原文链接:http://www.cnblogs.com/jiqing9006/p/5957361.html,如需转载请自行联系原作者