是
$(document).ready(function(){});
同上
$(function(){});
?
我相信是的,实际上我 99% 确定是这样,但想要“第二”意见
最佳答案
是的,是一样的。
来自 jQuery 文档 - http://api.jquery.com/ready/
All three of the following syntaxes are equivalent:
• $(document).ready(handler)
• $().ready(handler) (this is not recommended)
• $(handler)
关于jquery - 在 jQuery 中,$(function) 等同于 $(document).ready(function) 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3662693/