This screencast will teach you how to add admob to jQuery mobile with multi page support. Before jQuery mobile ajax feature caused an issue preventing this from working. Now have all of your pages support ads!

Download Source

Thanks to @pclaar for the jQuery fix code.


27 responses to “How to add admob to your jQueryMobile app, the right way”

  1. James says:

    I get the error “_admob is not defined” in firebug when I use this code. Using phonegap with jquerymob on android, testing on a PC with firefox. I think it occurs if admob does return an advert when I link to a page using an ajax request. Anyone else had this issue?

  2. This demo is not working the you wrote at the end is not closed. It is written an extra instead of

    Although I have changed this, I am getting the same β€œ_admob is not defined” error. I have included the js file. what could be the problem?

    The site is located in

  3. Wytze says:

    Your code is not working: I copied and tried your files, and just like in my own site, the Javascript runs, but does not produce a visible ad.

    I assume jQueryMobile or AdMob changed something in their inner workings. But I’d really like to know a solution.

  4. Anthony James says:

    I’ll see what I can do.

  5. jesus says:

    many, many thanks! (did I say Many thanks?)

  6. ahmad says:

    I see. Thanks james.. I didn’t see it because it is invisible, only after I highlighted that area, the download link will appear.

  7. Anthony James says:

    Interesting, Maybe a bug on my end. What browser are you running?

  8. ahmad says:

    IE9, Just now I test with firefox 7, it can display the download link.

  9. greg says:

    does anyone have a jquery mobile website with it working so i can see how it looks. Still cant get it to work.

  10. jojo says:

    Is it just me or is this not working?
    Maybe Google considers this as a TOS violation?
    I have tried your code and nothing gives.
    Is there maybe another bug fix?

    • Anthony James says:

      Well google keeps changing the way it works. Have you downloaded the git source? Last I checked that was correct, perhaps I’ll have to find another work around for the 3rd time.

  11. Anthony James says:

    The source is updated.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get actionable training and tech advice

We'll email you our latest articles up to once per week.