jQuery $(document).ready() not firing

安稳与你 提交于 2019-12-03 11:44:00

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.

you're missing a closing curly bracket and parenthesis in the second script tag

You are missing a }); in the end of the last $(document).ready

Once you correct this it should work

EDIT: Since you say now that each script tag is in a separate web part I believe the problem itself is not in the scripts. Something else in your page is messing up your code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!