views:

59

answers:

2

How do you make Firefox rerun javascript and reload the entire page when the user presses the back button? I was able to do this in all browsers except Firefox from the help of another SO question by adding this code:

history.navigationMode = 'compatible';
$("body").unload(function(){})

And also adding an iFrame... But this doesn't work in Firefox. Is there anything to do?

A: 

You could use that script to be found here:

http://www.easy-coding.de/wiki/html-ajax-und-co/onload-event-cross-browser-kompatibler-domcontentloaded.html#headline9

Demo: http://demo.easy-coding.de/javascript/onload-event-cross-browser/

Source: http://www.easy-coding.de/wiki/html-ajax-und-co/onload-event-cross-browser-kompatibler-domcontentloaded.html#headline8

This Script is under MIT/GPL License free to use.

Otherwise you could use the Gecko-Specific DOM Event: DOMContentLoaded

gearsdigital
+1  A: 

add this between your HEAD tags

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
jknair