【发布时间】:2011-07-25 06:12:31
【问题描述】:
可能重复:
What is the purpose of the anonymous function wrapper in jQuery?
在http://html5boilerplate.com/mobile/ 的 helper.js 文件中,脚本函数被包装在:
(function(document){
// js functions here
})(document);
诚然,我不是 js 方面的专家,但之前从未见过这种语法。我无法找到有关它的信息,尽管它似乎一定很常见。有人可以详细说明或指导我阅读吗?谢谢。
【问题讨论】:
标签: javascript mobile-website html5boilerplate