jQuery in Action, 2nd edition
The moose likes HTML, CSS and JavaScript and the fly likes disable back in Opera Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "disable back in Opera" Watch "disable back in Opera" New topic
Author

disable back in Opera

Rahjesh
Greenhorn

Joined: Apr 20, 2004
Posts: 1
Hi,
In my site i disabled the back buton using the script
javascript:window.history.forward(1);
Its work fine in IE & Netscape.But its not working in Opera.
What will be the solution.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Its work fine in IE & Netscape.

I bet it doesn't. Remember that this is client side scripting, so any server side code will still run before this forwards the user. This is always a dodgy thing to do, and you are far safer coding your application to expect the user navigating back, rather than trying to stop them doing this.
As with any client side script you always get issues cross browser. It looks like a quick fix, but generally is not. I'm not surprised this doesn't work in Opera; have you tried it on Konqueror, Safari, Mozilla, Camino, OmniWeb, iCab and Lynx yet?
You might want to repost this in the JavaScript forum for some more detail.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4120

"Rahjesh" -

Welcome to the JavaRanch! We don't have many rules around the 'Ranch, but we do require your display name to follow the
JavaRanch Naming Policy.
You can change it here.

I'll go ahead and move this thread to the JavaScript and HTML forum, because that's where your real problem lies...


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
 
subject: disable back in Opera
 
Threads others viewed
How can i disable backward and forward buttons of the browsers using js,in struts2
Which browser do you use?
browser jumping to historical page
Logged out access
compile error
IntelliJ Java IDE