 |
Javascript How-To Ask your "How do I do this with Javascript?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

September 20th, 2005, 02:09 PM
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Browser history
Hi
How to Clear the Browser History using Javascript
quick response would be appreciated
Cheers
Abdul
|

September 20th, 2005, 03:26 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
you can't
Imar
|

September 22nd, 2005, 04:05 PM
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
can i know how u said it's not possible
|

September 22nd, 2005, 04:49 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|

October 4th, 2005, 04:17 AM
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You could load an instance of Excel and use it's Sendkeys method.
Cheers
Joe
|

October 4th, 2005, 05:00 AM
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
its not recommended adbul
www.crmpicco.co.uk
|

October 11th, 2006, 04:53 AM
|
Registered User
|
|
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi Imar
can u advice me the ways to stop your pages being
added to the Browser's history
thnx and rgds/-
|

October 11th, 2006, 04:58 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Like I suggested earlier: with location.replace.
So, instead of regular <a href> tags, use JavaScript with location.replace.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|

October 11th, 2006, 05:18 AM
|
Registered User
|
|
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 11th, 2006, 06:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
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)
|
|
 |