I wrote a plug-in for jQuery that copy the the output of the ads JavaScript to there container Div.
so i put the Ads JS at the bottom of the page (so they will not decrease my page load speed) within inadvisable Divs that looks like:
<div id="ad_loader_4" class="ads_loader"></div>
the id of those divs point to the container divs. the container divs looks like:
<div id="ad_4"></div>
the jQuery plug-in waits for the page end loading and then grabs all the elements that created in the invisible divs and appends them to the container div.
The jQuery Plug-In looks like:
(function($) {
// jQuery plugin definition
$.fn.adsLoader = function(params) {
// merge default and user parameters
params = $.extend( {}, params);
// traverse all nodes
this.each(function() {
// express a single node as a jQuery object
var $t = $(this);
// find id
var id = $t.attr('id');
id = id.substring(10,id.length);
$t.children().not('script').appendTo("#ad_"+id);
});
// allow jQuery chaining
return this;
};
})(jQuery);
that plug-in works great in FF and Chrome And IE8...on Adsense and some other Ads programs...but the problems begins On IE7...From some reason, sometimes the ads loads in the containers and sometimes they not...
What is wrong with my plugin?