Back button causes iFrame to delay window.onLoad event
- by JoJo
I serve ads through an iFrame. The ad network's servers are much slower than mine, so I asyncronously load the iFrame after the window.onLoad event.
Event.observe(
window,
'load',
function() {
$('ad').writeAttribute('ad.html');
}
);
A problem occurs when you enter the site via the browser's back button. Unexpectedly, the ad iFrame attempts to load immediately, delaying window.onLoad for a few seconds. During these few seconds, the site is unusable because I do a bunch of initialization after window.onLoad. As far as I know, this only happens in Firefox. How do I prevent this blocking load?