Jump to content

How to refresh leadbotl banner


NokFrt
 Share

Recommended Posts

I want to show Leadboalt ads in my game. According to Leadbolt: Ads are served only when the javascript code is loaded, the ad will not be refreshed until the javascript code is loaded again. 

I wrote the following code to load the ads, but it doesn't work - I don't see any ads, it looks like I can't load javascript dynamically. Can you please someone tell me what could be wrong with my code? If I put the leadbolt script directly into the ads_container (div) in index.html then a banner is displayed, but I don't know how to refresh it.


function showAdsBanner(aPos, aSrc, aRefreshRate)
{
var adsContainer = document.getElementById("ads_container");
adsContainer.style.top = aPos + "px";
adsContainer.style.display = "block";

var script = document.getElementById("ads_banner");

if (script)
document.removeChild(script);

script = document.createElement("script");
script.id = "ads_banner";
script.type = "text/javascript";
script.src = "http://ad.leadboltmobile.net/show_app_ad.js?section_id=485846630";
adsContainer.appendChild(script);

...
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...