Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

do not move to previous page

Status
Not open for further replies.

bbvic

Technical User
Oct 21, 2004
51
0
0
US
I have three pages.

test1.html
test2.html
test3.html

I am on test3.html and when i click the previous button on the top tool bar, it moves to test2.html.
I do not want to move to there. I want to move home which is test1.html

How can i do that??
 
It may be possible with an ActiveX object, but what you are wanting to do is not possible in Javascript.

Javascript can't control the built-in functions of the browser.

[monkey][snake] <.
 
what if it compares the value in test2.html to test3.html,

if the value is same, then replaced to test1.html.

is it possible?
 
This will not work for every visitor, but you could set a cookie on test3.html and then check if the cookie exists on test2.html

Code:
if(cookieExists() && document.referrer.toLowerCase().indexOf("test1.html")==-1){
  deleteCookie();
  location.replace("test1.html");
}

function cookieExists(){
  // check for your cookie here
}

function deleteCookie(){
  // delete your cookie here.
}

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top