I just built www.LeftyStrats.com, but the site loads slow because of the ebay ads which are done in javascript. The problem is the body of the page and all the content has to wait for them to load before anything will appear. I was wondering if there was a way to make the ebay ads load last. I tried to put defer="defer" in the script but it just made them the only things on the page. Any advice would be helpful. Thanks
you could add a element for it and than at the bottem of the page use a javascript to add the ads in the element for example: >Banner ><div id='ads'>Loading ads</div> >Site content >copyright >document.getElementById("ads").innerHTML='ebay ads'
Good question. Possible solutio: window.onload = function(){ //load the ads after everything else has already loaded var ebayAds = document.createElement('script'); ebayAds.src = 'http://lapi.ebay.com/ws/eBayISAPI.dll'; //Path to js file. ebayAds.type = 'text/javascript'; document.body.appendChild(ebayAds); } PHP: I use window.onload because it only fires after everything has loaded. @godkillah: You're telling me you know JavaScript?
try adding the defer attribute in first.. may well work, failing that the onload method <script src="" defer="defer"></script>
This work fine with text/plain html, but if i insert javascript like google it doesn't work. Can you help me?