Why does Firefox 5.0.1 not refresh this page when the back button is pressed?
<html>
<head>
<meta http-equiv="cache-control" content="no-cache">
<script src="http://code.jquery.com/jquery-1.6.2.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() { alert('ready'); });
$(window).load(function() { alert('load'); });
</script>
</head>
<body>
<form action="http://www.google.com" method="get">
<input name="q" type="text">
<input type="submit">
</form>
</body>
</html>
Steps to reproduce:
- Click "Submit Button"
- Press Back
- Neither document.ready or window.load fires
Update:
This will to force firefox to reload the page:
$(window).unload(function() {});
But, I ended up using this:
window.addEventListener('pageshow', function() {alert('pageshow'); }, false);