I have a web page with a number of iframes, including 3rd party iframes like ad sense and various sharing buttons.
In Firefox, I've noticed that occasionally the content of these iframes get swapped, such that you'll get an ad sense ad where another iframe is. It seems completely random where iframe content shows up. It seems it may have something to do with caching.
Does anyone know what causes this, or any steps I can take to prevent this from happening?
I've been wrestling with this for awhile now. The problem is with firefox and the way that it caches iframe content. It's not random either. There is nothing to do to prevent this short of not using iframes.
You can reload the iframes onload using something like:
In the case of ads it will cause double impressions which will violate you contract.
An easy way to replicate the issue is create 3 html files.
Open in firefox. Then switch frame one and frame two.
Refresh index.html. The iframes will not be swapped until you clear your cache.
There is a bug in at mozilla but no one is currently working on it.
The workaround described in that Mozilla bug report worked for me:
In case anyone is looking I was able to track down the bug report:
https://bugzilla.mozilla.org/show_bug.cgi?id=356558
It's been 4 years and it doesn't even look like they have confirmed it.
This problem maybe similar to yours
try to put
together with body unload.
i have the tool tip javascript on head segment which contain
but conflict with my onload iframe
my solution : delete that window.onload = initTip; from head segment, then put them into body.
it's work with reload button on firefox
One plausible answer is that two iframes have the same name. I've experienced this several times in conkeror (firefox based), and every time it's been a name conflict.