Click here to Skip to main content
15,868,340 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In IE i can if i give backspace means the page is not refreshing and also not going back. But in Firefox the page is not going back, but refreshing when i click the back button or pressing the backspace. How can i disable refresh in Firefox using javascript?


My JS Code:

XML
<script type="text/javascript">
        function noBack()
        {
        window.history.forward()
        }
        noBack();
        window.onload = noBack;

        window.onpageshow = function(evt)
        {
        if (evt.persisted)
        noBack()
        }

        window.onunload = function()
        {
        void (0)
        }
        </script>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900