Clear history / Return to homepage
-
Hi All, I'm trying to clear my browsing history then redirect the browser to the homepage when the Home link is clicked by using the following javascript code :
function Home()
{
var Backlen=history.length; history.go(-Backlen);window.location.href=index.html;
}The following is how I call the function inside the body of my HTML page
Please point out why my javascript code is not working, it does not redirect the browser to the homepage. What I want the code to do when the link "Home" on a page is clicked is clear the browser history, then redirect the browser to the homepage if I am on another page and not on the homepage. Thank you in advance for your help.
-
Hi All, I'm trying to clear my browsing history then redirect the browser to the homepage when the Home link is clicked by using the following javascript code :
function Home()
{
var Backlen=history.length; history.go(-Backlen);window.location.href=index.html;
}The following is how I call the function inside the body of my HTML page
Please point out why my javascript code is not working, it does not redirect the browser to the homepage. What I want the code to do when the link "Home" on a page is clicked is clear the browser history, then redirect the browser to the homepage if I am on another page and not on the homepage. Thank you in advance for your help.
Why what is not working? The link is not working? The JavaScript is not working? Which part of it? You need to give a little more detail. Edit you post to include this information. Format the code snippet while your at it. Use the "code" toolbar item.
No comment
-
Why what is not working? The link is not working? The JavaScript is not working? Which part of it? You need to give a little more detail. Edit you post to include this information. Format the code snippet while your at it. Use the "code" toolbar item.
No comment
-
Hi All, I'm trying to clear my browsing history then redirect the browser to the homepage when the Home link is clicked by using the following javascript code :
function Home()
{
var Backlen=history.length; history.go(-Backlen);window.location.href=index.html;
}The following is how I call the function inside the body of my HTML page
Please point out why my javascript code is not working, it does not redirect the browser to the homepage. What I want the code to do when the link "Home" on a page is clicked is clear the browser history, then redirect the browser to the homepage if I am on another page and not on the homepage. Thank you in advance for your help.
Just looking at your code your issue maybe with the javascript function called Home(), but you call it in the like as home() On a *nix server this may not fly as they are different "H" and "h"; As for clearing the browser history of you visitor, I'm not sure you can (I could be wrong though) but that is something the user can do, not a script. If you want to keep the user from doing a browser refresh and resending post variables, there are methods to do so and they do not invovle the users history.
Chris J www.redash.org