Is it allowed to have more than one document.ready in a page? [duplicate]
开发者_C百科Possible Duplicate:
JQuery - multiple $(document).ready … ?
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.
精彩评论