p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   Browser history (http://p2p.wrox.com/showthread.php?t=33553)

abdul_owiusa September 20th, 2005 02:09 PM

Browser history

How to Clear the Browser History using Javascript

quick response would be appreciated


Imar September 20th, 2005 03:26 PM

you can't


abdul_owiusa September 22nd, 2005 04:05 PM

can i know how u said it's not possible

Imar September 22nd, 2005 04:49 PM

You asked for quick response, so I gave you one ;)

Anyway, the browser's history is something a page / JavaScript cannot control. Only the user can clear the history. If you think of it, you should be glad that's the case. How would you find it if some site just cleared your history, so you couldn't go back to a previous page, like search results in Google?

There are ways to stop your pages being added to the history. You can use location.replace instead of location.href. The results of this may vary, though....

Imar Spaanjaars
Everyone is unique, except for me.

interrupt October 4th, 2005 04:17 AM

You could load an instance of Excel and use it's Sendkeys method.


crmpicco October 4th, 2005 05:00 AM

its not recommended adbul


vishals October 11th, 2006 04:53 AM

hi Imar
can u advice me the ways to stop your pages being
added to the Browser's history
thnx and rgds/-

Imar October 11th, 2006 04:58 AM

Like I suggested earlier: with location.replace.

So, instead of regular <a href> tags, use JavaScript with location.replace.

Imar Spaanjaars
Everyone is unique, except for me.

vishals October 11th, 2006 05:18 AM

hi, imar
thnx for ur quick reply

i m using 3 aspx pages. webform1.aspx,webform2.aspx,
webform3.aspx. all the three pages are linked after one another.
what i want to do is, i want to restrict the user from viewing
webform2 page after he reaches to webform3. in other words user
after reaching on webform3 the browser's back button shud get
disabled. i tried using history.go method but it affects redirection of
other hyperlinks on the webform3 page.
in this case how do i use the location.replace() method. and on which page/event should i use it?
wht can be the possible solution?
thanks and regards

joefawcett October 11th, 2006 06:00 AM

What you're asking is impossible, you can't prevent the user going backwards by controlling the browser. You need to re-think the design and enforce the requirements server-side.


Joe (Microsoft MVP - XML)

All times are GMT -4. The time now is 04:03 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.