I’m building a simple content app using PhoneGap + jquery mobile. My AdMob banner is placed at the bottom of each page. The ads appear correctly, but I need them to update/refresh as the user transitions back and forth between pages. Because I’m using jqm’s ajax transitions, the pages are cached, and the scripts never reload. I also tried to find an option within the AdMob admin options to set the refresh frequency, but it doesn’t appear to exist if I’m using the website embed code.
I tried this:
var admobscript = '<script type="text/javascript" src="http://mmv.admob.com/static/iphone/iadmob.js"><\/script>';
$('#admobbanner').html(admobscript);
But no luck. It feels like an ugly solution anyway and I have a feeling I’m missing something much more elegant. Thanks in advance.
If you read through the documentation they offer a few ways to fetch ads:
You could do something like:
or you could store the ad in an iframe and refresh it like: