matthewb
01-19-2003, 04:12 AM
Hiya. In need of a little help on a kind of “go back one page OR do something else” function. If that makes any sense...
At the moment I have:
{
alert("Site Closed.\nClick OK to return.");
history.go(-1);
}
The problem is – if the page is the first that the person has visited (they went there directly) then there is no ‘-1’ to send them to. So I’d like something that works along the lines of:
if no ‘-1’ page exists then parent.close()
But I’m entirely unsure if and how you can find out that there is no ‘-1’ page and how you’d then trigger the window close event instead.
Any help would be most appreciated.
Cheers :)
Matthew
PS: If you could make it thicky-proof that'd be even more helpful :p
At the moment I have:
{
alert("Site Closed.\nClick OK to return.");
history.go(-1);
}
The problem is – if the page is the first that the person has visited (they went there directly) then there is no ‘-1’ to send them to. So I’d like something that works along the lines of:
if no ‘-1’ page exists then parent.close()
But I’m entirely unsure if and how you can find out that there is no ‘-1’ page and how you’d then trigger the window close event instead.
Any help would be most appreciated.
Cheers :)
Matthew
PS: If you could make it thicky-proof that'd be even more helpful :p