If we bind an event from an iframe content to its parent window and use a property set on the iframe content window in order to update a counter (eg. window.counter), whenever we refresh the iframe page the counter property doesn't seem to be correctly reinitialized. The iframe page should set the window.counter to 0 each time the page is reloaded, but the counter property seems to keep previous value.
I've been able to reproduce this issue on Chrome and Opera. On IE and Firefox there is no issue.
To better expose this issue I created a fiddle snippet:
To reproduce the issue, first try to click outside the iframe: the counter will increment by 1 each time a click event is triggered. Then, click multiple times on the "Reload this page" link and then click outside the iframe. You will see the counter is now incremented by the number of times you clicked on the link not by 1 as it should.
Tested browser :
- Opera 23.0.1522.60 (doesn't work)
- Chrome 36.0.1985.125 (doesn't work)
- IE 11.0.9600.17207 (work correctly)
- Firefox 31 (work correctly)
All jQuery versions seem to be impacted (branches 2.x and 1.x)