开发者

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

开发者 https://www.devze.com 2023-03-02 02:09 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: JQuery - multiple $(document).ready … ?
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

精彩评论

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