File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Back Button & Mouse Risk click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Back Button & Mouse Risk click" Watch "Back Button & Mouse Risk click" New topic
Author

Back Button & Mouse Risk click

sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
Hii,
can anyone pls. tell me, (a) how to disable IE Browser Back button using JavaScript. (b) how to disable the Mouse right click button in the above said page.
With Thnks and Rgds,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
WHY! Do you want to do this??
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
I want to incorporate this in my Application...
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I figured that out, but what purpose is this serving?
You can not disable the back button.
If you want a useless script then sarch google for "No Right Click JavaScript" and you will find 100's of them.
People hate when you mess with their browsers, you can not hide code/pictures/text/etc since it exsists in your cache. Are you also going to disable (ALT <-) combo too?
If you are doing both of these to keep a user from going back to the previous page there is a better solution. Plus a person can disable JavaScript and get around all your little things.
Eric
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
can you pls. tell me that best solution???
cheers,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
best solution would be server side
instead of a link you can use
document.location.replace("theUrl");
It replaces the current page in the history so you can not go back to it.
Another bad solution that I am known for on the net is this link:
http://www10.brinkster.com/A1ien51/basics/backbutton.htm
Eric
sakthi shan
Greenhorn

Joined: Dec 12, 2003
Posts: 14
can you pls. tell me the solution for back button - disabling alone???
With Thanks,
SSV.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not just disable he back button. You have to do either of the things I said above. The replace method or the link...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Back Button & Mouse Risk click