tl; dr Displaying mobile ads using pure Javascript:
I went through this a long time, and your request (JavaScript code), unfortunately, is not available with either mMedia or AdMob.
mMedia : They have the following types of source code for a mobile website (not an Android app): ASP, Perl, PHP, JSP5, ruby โโon rails and vb.net. in order to get the source code, you need a mobile website and the mobile website must be approved by mMedia, then you will receive real-time advertisements, and I think if you would use the source code of the website in your Android application, their account will be suspended because in mMedia each project must be approved first so that they expect their ads to appear in the project that they approved. And in any case, the JavaScript code is missing. mMedia will provide with sdk instructions for downloading and installing in your application, after which the ads will be displayed live, and I think you do not want to.
AdMob : itโs a bit confusing to read about them, because in the past they used ads using the JavaScript method intended for but after Google buys the company, they deleted it and AdMob no longer serves the mobile site, and for the mobile website they advise you to use adsense. which confuses him, that there is still an instruction for installing JavaScript AdMob, which no longer exists. I saw your links, and I think you're trying to install the AdMob app for iOS. I did it for an Android application that was straightforward and it was easy to use In-App-Advertisements , but the problem is that I am ever trying to show it below.
AdSense : they have a JavaScript method, but they do not allow it to be used in mobile applications, and if they find out they will be blocked by your account ( details ).
for MobFox : they serve for advertising for a mobile website, and for source code for a mobile website: JavaScript, PHP, cURL, PHP, fSocket, J2SE 1.4, CGI / Perl and ASP.NET. and for the application you need to download the SDK. but thereโs nothing in MobFox that you cannot use your JavaScript for a mobile application, and they work like Google after you are approved, you will receive a publisher ID and do whatever you want without violating their terms. Unlike mMedia, they must first approve everything. And they have the mediation option in the advertising network for the following companies: 4INFO, Aditic (Sofialys), Adfonic, AdMarvel, Admoda, BuzzCity, Hunt, mobile ads, InMobi, iVdopia, JumpTap, Komli Mobile (ZestAdz), Lumata Group (bMobile) , m-perf, Madvertise, MdotM, MobGold, MobPartner, Mocean, Mojiva, Nexage Exchange, Smaato, TapIt !, Vserv, WapStart, YOC performance (Mocean platform), YOC performance (Ubiyoo platform)
As for my research, the only option you have for JavaScript code will be with MobFox, and you need a way to get approval so that you have a publisher ID. I have a mobile website containing 4 pages with little traffic, such as 20 per day, and I got approval.