I have a situation where pressing F5 or CTRL+R causes a frameset to load a frame twice. It happens on localhost, but as I've just put together an example for this question and uploaded it, I notice it varies by browser.
Visiting the link for the first time or clicking the browser address bar and hitting enter performs a 'normal refresh', as desired.
The test case I put together below has 2 frames, one left empty. When frame1.html loads, the frameset then sets frame2's src, which then loads frame2.html. Both should alert only once, but you'll see that is not the case for 'frame2.html'.
Behaviour-by-browser:
I tried clearing the src attribute on the frameset's unload event in the hope it might at least load nothing before doing the double-up and then loading frame2.html, but even if that had worked (which it didn't) it's nasty.
My questions:
Here's the link: http://codefinger.co.nz/public/frameset_test/frameset.html and also the rar'd files: http://codefinger.co.nz/public/frameset_test/frameset_test.rar
Ok, lack of an explanation drove me mad, but I did find a way to stop this default, inconsistent behaviour.
I listen to the frameset's window.unload event (YUI3.5), and remove the double-up frame node altogether. The double-up goes away, everything appears normal.
Tested successfully in (both localhost and live server):
Does not work in:
I'll still +1 for any explanations as to why the frameset load double-up occurs in the first place.