HELP: FireFox page reload bug using jQuery for deferred load

HELP: FireFox page reload bug using jQuery for deferred load

Hi all,

To enhance user experience on my site, I've moved a few page elements (well, the ads...) to the end of the page (in a hidden div) and when the page is loaded the content of such divs are copied to their appropriate location on the page. This makes the content load much faster and thus not delay the user.

So what I did works perfectly with IE/Opera but th FireFox is causes the page to try and reload, which it never succeeds to and so we're stuck with a blank page. So yes, the problem is that there are document.write calls inside those divs which contain script but I cannot change it (google ads / ebay ads).

Any ideas?

I even tried to use setTimeout() to ensure the content is loaded (and can see that it is) but still when the move is done, the page tries to reload.

HTML side:
...
<div id="xxx_slot"></div>
...
<div id="xxx_slot_data"> content goes here</div>


jQuery side:

$(document).ready( function() {
   $('.slot').each(function(){
      var sloti = this;
      setTimeout(function(){$(sloti).removeClass('slot').html($('#'+$(sloti).attr('id')+'_data').html());}, 5000);
   });
});



Thanks in advance :)