Javascript:Change the Function of the Browser'S Back Button

Javascript : Change the function of the browser's back button

You can't override the behaviour that if a user follows a link to your page, clicking Back will take them off it again.

But you can make JavaScript actions on your page add entries into the history as though they were clicks to new pages, and control what happens with Back and Forward in the context of those clicks.

There are JavaScript libraries to help with this, with Really Simple History being a popular example.

Change back button functionality in browser using jQuery

I think you can set a session variable on your form in http://website.com/page3.php. and then unset it once the submission is done in http://website.com/page3.php?ok=ok.

and each time the page with the variable in the url is loaded, check immediately for the submission session variable to see if you are redirected to the page from the form page. and if not, redirect you back to the page3.page.

I hope I made myself clear enough!



Related Topics



Leave a reply



Submit