Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi CP,

I'm using Lakequincy Ads on my website (http://www.windowsvalley.com) but when pages render, pages get stuck due to ads. I read about loading ads after page on web but wasn't successfull.

I checked codeproject.com, using the same lakequincy ads but they're loading flawlessly.

How can I load ads after whole page is initialized?

- Ramesh
Posted
Updated 21-Nov-10 18:49pm
v4

Hi Ramesh,

I've modified my answer to wait two seconds after the body on load event before triggering the ad loading stuff:

<body onload="doStartTimer();">
<!-- Rest of page here -->
<script type="text/javascript">
    function doLoadAdStuff()
    {
        //do ad loading stuff here
    }
   
   var myTimer;
   function myTimerEvent()
   {
      doLoadAdStuff();
   }

   // Lets do the ad loading stuff after 2 seconds == 2000 ms after the body load event
   function doStartTimer()
   {
       myTimer = window.setTimeout("Every100();", 2000);
   }

   window.onunload = new Function("clearTimeout(myTimer);");
</script>
</body>


Cheers

Manfred
 
Share this answer
 
v3
Tried but didn't work. As I said codeproject.com already implemented it using some
s.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 22-Nov-10 8:46am    
Did you try my newest modification. It sets a timer that waits for two seconds after the bodies onLoad event.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900