Posted by : Deepak Vasudevan Wednesday, October 08, 2008

An effective way to Null-And-Void Browser Back Button Effect

Handling browser back buttons is always been a great nightmare for web developer fraternity worldwide. But a little fiddling into JavaScript, can get one a great asset that helps one to tide over this issue. The location object of JavaScript has a method called replace which takes a URL as a parameter. When invoked, it replaces the current history entry with the new one and hence the browser back button item would actually contain the new URL.

Example:

1) You are currently in http://www.yourwebsite.com/test.html .
2) In window.onLoad, call
location.replace("test2.html")

The web browser would move into test2.html however, the back button would no longer contain an entry for test.html. You can inspect the contents of history in back button by pulling the small arrow in the browser back button.

Popular Post

Blogger templates

Labels

Blog Archive

Followers

Blog Archive

Powered by Blogger.

- Copyright © Lavanya Deepak -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -