I don’t understand why I’m getting this problem. This is my code:
var admobid = {};
if( /(android)/i.test(navigator.userAgent) ) { // for android
admobid = {
banner: 'ca-app-pub-xxxx,
interstitial: 'ca-app-pub-yyyy'
};
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) { // for ios
admobid = {
banner: 'ca-app-pub-xxxx',
interstitial: 'ca-app-pub-yyyy'
};
}
if(typeof AdMob !== "undefined") AdMob.createBanner( {
adId: admobid.banner,
position: AdMob.AD_POSITION.TOP_CENTER,
autoShow: true } );
else alert("Admob is not defined");
I just don’t see why I’m getting the not defined error. I’m using my own AdMob references obviously. And I am testing it on an Android phone.
Any ideas?