开发者

Is it allowed to have more than one document.ready in a page? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

JQuery - multiple $(document).ready … ?

开发者_C百科

Does it matter if we have more than one document.ready in a page? because I have some JavaScript files which all of them have this phrase inside. Will it cause problem? Any logical or syntax problem?


Nope, that is fine.

One more great thing about $(document).ready() that I didn't mention in my previous post is that you can use it more than once. In fact, if you don't care at all about keeping your code small, you could litter your javascript file with them

Source.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜