I want to make sure that an affiliate banner ad only loads after all the images are loaded. The banner is just a script tag:
<SCRIPT type="text/javascript" src="cjbannerlink"> </SCRIPT>
I've read a few threads and here's one of the codes that I've tested fiddle:
$(window).bind("load", function() {
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "cjbannerlink";
// Use any selector
$(".1").append(s);
});
Nothing seems to happen. The banner doesn't appear in the div. Would anyone please tell me if it's possible to fire the banner script last?
Try
$(document).ready(function() { // code here });
instead:Click me.