Hi, How to control the navigator’s back button ? It is possible to redirect the page where i want or stop the session when the user press on back button ? Thank you,
@Phil_KarrasFeb 26.2003 — #At one time we could do just about anything to the array of URLs in the previous var, unfortunately I'm not sure we still can. Things were changed when security issues came to light and so all browsers & JS changed to protect previous URLs from being printed, etc.
Now, as to controlling the back arrow button uses something like the JS method:
[b]history.go(-1);[/b]
You can make your own buttons that can go back or forward any number of places, as in:
[b]history.go(-3);[/b] - back three URLs, if they exist.
Now, as to loading the array of past URLs? Again, I don't think we have that control any longer.
Anyone else know differently?
There's the var: [b]document.referrer[/b]
and then there was the array (I believe): [b]history.previous[/b]
If I include/understand well, it there not JavaScript event which makes it possible to control the back button of navigator. However, in certain banking sites when you click on the back button during a session the site you log off automatically. Any idea?
@Phil_KarrasFeb 27.2003 — #OK, while we can not control the action of the browser back arrow button (BA? we can control what happens when you leave our page.
[b]onBlur[/b] fires whenever focus moves to another page, or the BAB is used, also I believe there's onUnload() which fires when the user tries to leave your page: <i> </i><body onUnload='OutOfHere();'>
Where [b]OutOfHere()[/b] is a function called when this page is exited. (The BAB is pressed.)
@Phil_KarrasFeb 27.2003 — #I must admit that I have never seen "[b]sub[/b]" used in JavaScript. The correct form (as supported by the w3c standard) is: <i> </i><SCRIPT LANGUAGE="VBScript" > <!-- function OutofHere() { // code goes here } --> </SCRIPT>
<SCRIPT LANGUAGE="VBScript"> [b]Sub[/b] is a part of VBScript.
Phil, you are correct, it is NOT JavaScript, and therefore jean, you are posting in the wrong forum (although you can continue with this thread if you want to learn how to do it in JavaScript).