on 10-27-2006 8:49 AM
Hi All,
i want to disable the back button appearing the toolbar in the browser. I either want to disable or hide that button or on clicking on the back button i want to remain on the same page.
I have tried using window.history.forward(1);, Now when i click on the back button it doesn't allow me to move back instead keep me on the same page. This thing works fine in IE but now i want to have the same functionality in case of Mozilla. can anyone help me with some javascript or any other option.
Thanks.
This will work with Mozilla firefox:
This will allow you to turn the back buttons function off with the functions blockBackButton()
And turn it on again with resetBackButton()
The script uses the get part of the url, but wont permanently change it because if the browser get a changed get part of the url, the script will reload the earlier page where the url was unchanged.
var ie = (window.navigator.appName == "Microsoft Internet Explorer") ? true : false;
function setEventByObject(object, event, func){
if (!ie){
object.addEventListener(event, func, false);
} else {
object.attachEvent("on" + event, func);
}
}
setEventByObject(win, "unload", exitme);
var block = "false";
function blockBackButton(){
block = "true";
}
function resetBackButton(){
block = "false";
}
function jumpforward(){
if(window.location.href.indexOf("&jumpforward")!=-1) {
history.forward();
}
}
jumpforward();
function exitme(){
if(block == "true") window.location.href += "&jumpforward";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this web log
/people/sergio.ferrari2/blog/2005/04/18/bsp-howto-back-navigation--the-nightmare-of-statefull-web-applications
Eddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.