Ticket #8684 (closed bug: invalid)
Back button doesn't trigger $(window).load() in Firefox on jQuery >= 1.4
| Reported by: | st.dave@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | unfiled | Version: | 1.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Using a version of jQuery later than 1.3.2, the $(window).load() event isn't fired when you come to a page via the back button. It fires correctly on the inital page load, but subsequent visits via the browser history do not trigger the event.
The bug appears in Firefox 4.0 on Windows, Firefox 3.6.13 on Red Hat Linux, Safari 5.0.3 for Windows and Mac OS X, and Opera 11.01 on Windows. I cannot reproduce it in Internet Explorer 8.0 or Chrome 10.0.648.133 for Windows.
I have created a simple webpage that demonstrates the bug using various versions on jQuery from 1.2 - 1.5.
Reproducing
- Open a webpage that has an event fire on $(window).load()
- Click a link to navigate to another page.
- Click the back button to return to the first page.
Observed Behavior: - The $(window).load() event does not fire when the original page is accessed via the back button.
Expected Behavior: - The $(window).load() event should fire when the page is accessed this way.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

More information about this can be found here: https://developer.mozilla.org/en/using_firefox_1.5_caching#pageshow_event
If you wish to cause a page reload you can always just bind an event to window unload.
$(window).unload(function(){});What's happening right now is the intended behavior of the browser.