How to add admob to your jQueryMobile app, the right way

Anthony James —  July 26, 2011

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.

Anthony James

Posts Twitter Facebook

Anthony is a Web Software Developer & Linux Systems Engineer. With 11 years of experience in these fields. He is also the founder and main contributor at He is passionate about passing on his technical knowledge through training and educating others.

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

  1. 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. 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. I’ll see what I can do.

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

  6. 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. Interesting, Maybe a bug on my end. What browser are you running?

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

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

  10. 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?

    • 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. The source is updated.