可能重复:
jQuery 中匿名函数包装器的目的是什么?
在http://html5boilerplate.com/mobile/的 helper.js 文件中,脚本函数包含在:
(function(document){
// js functions here
})(document);
诚然,我不是 js 专家,但以前没有见过这种语法。我无法找到有关它的信息,尽管它似乎一定很常见。有人可以详细说明或指导我阅读吗?谢谢。
可能重复:
jQuery 中匿名函数包装器的目的是什么?
在http://html5boilerplate.com/mobile/的 helper.js 文件中,脚本函数包含在:
(function(document){
// js functions here
})(document);
诚然,我不是 js 专家,但以前没有见过这种语法。我无法找到有关它的信息,尽管它似乎一定很常见。有人可以详细说明或指导我阅读吗?谢谢。