How To Disable Ajax In jQuery Mobile Before Page Load?

后端 未结 4 2092
迷失自我
迷失自我 2020-12-05 06:43

On my mobile website. I\'ve been trying to load Adsense Mobile ads, but they continue to take up the entire page after the page loads itself.

I did figure out that i

4条回答
  •  情话喂你
    2020-12-05 07:35

    Check-out the docs for binding to the mobileinit event: http://jquerymobile.com/demos/1.0/docs/api/globalconfig.html

    Specifically this bit:

    Because the mobileinit event is triggered immediately upon execution, you'll need to bind your event handler before jQuery Mobile is loaded.

    Here is the proper format for binding to the mobileinit event:

    
    
    
    
    

    First the jQuery Core (so .bind() will be available), then the mobileinit event handler, then the jQuery Mobile js file (this is last so the event handler for mobileinit will be set before the event is fired).

    You can test that your current mobileinit event handler is not firing by putting an alert in the function.

提交回复
热议问题