jQuery $(document).ready() not firing

后端 未结 3 1750
猫巷女王i
猫巷女王i 2021-02-13 22:06

Using jQuery 1.4.2 from Google hosted Code.

Is there a reason why the following javascript does not fire all 3 document.ready functions when the document is ready?

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-13 22:33

    I can think of three forensic things to try, right off:

    1. try it with non-google-hosted libraries.
    2. comment out the Cufon calls -- I believe Cufon does some crazy stuff to download additional resources, yes? That may be interfering.
    3. sub in $(window).load() for one or more of your $(document).ready() callback defs. They have different firing criteria -- $(window).load() waits for everything to load up, allegedly -- but the substitution may be revealing.

    Of course, console.log() and alert() will be your in-leu-of-debugger-breakpoint best friends in this case.

提交回复
热议问题