Skip to main content

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

Posted on July 26, 2011 by Anthony James Founder/CEOAnthony James Founder/CEO

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.


 

12 Comments

Image of James
James
8 years ago

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?

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

I suspect your not including the javascript file. Can you check that?

Reply
Image of Said Tahsin Dane
Said Tahsin Dane
8 years ago

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 http://home.ku.edu.tr/~sdane/deneme/oss

Image of Wytze
Wytze
8 years ago

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.

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

Google made some changes on allowing admob into web apps. You might want to check out those new policies. I’ll take a look this week and create another tut for you.

Reply
Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

I’ll see what I can do.

Image of pablo
pablo
8 years ago

Thanks a lot can’t wait!

Reply
Image of jesus
jesus
8 years ago

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

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

Anytime 🙂

Reply
Image of ahmad
ahmad
8 years ago

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

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

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

Image of ahmad
ahmad
8 years ago

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

Image of greg
greg
8 years ago

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

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

Checkout the new source i has a fix since google changed admob. Example is working in source

Reply
Image of agus @ jQuery Mobile Apps
agus @ jQuery Mobile Apps
8 years ago

Thanks for the link..

Image of jojo
jojo
8 years ago

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?

Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

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.

Reply
Image of Anthony James Founder/CEO
Anthony James Founder/CEO
8 years ago

The source is updated.

Leave a Reply

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