Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Can we disable the browser 'Back' button using Javascript code or anything?

Thread view: 
Raj - 08 Dec 2005 18:51 GMT
Right away, the best possible solution I have is to force the 'back'
button to forward it to the current page. The JavaScript snippet I am
using is:

<script language="JavaScript">
javascript:window.history.forward(1);
</script>

Since I do not intend to allow the user to go back at all, I am
wondering if there is a better way, like disabling the 'Back' button
altogether. My quick research resulted in "NOTHING", but I just could
not give up...any help?
Steve W. Jackson - 08 Dec 2005 19:49 GMT
> Right away, the best possible solution I have is to force the 'back'
> button to forward it to the current page. The JavaScript snippet I am
[quoted text clipped - 8 lines]
> altogether. My quick research resulted in "NOTHING", but I just could
> not give up...any help?

The Javascript groups are elsewhere...
Signature

Steve W. Jackson
Montgomery, Alabama

Oliver Wong - 08 Dec 2005 20:21 GMT
>> Right away, the best possible solution I have is to force the 'back'
>> button to forward it to the current page. The JavaScript snippet I am
[quoted text clipped - 10 lines]
>
> The Javascript groups are elsewhere...

   Well, the subject line reads "javascript code or anything". With respect
to Java (as in applets or JSP), I believe the answer is "no", unless the OP
is implementing his/her own browser in Java, in which case the answer is
"yes".

   - Oliver
Heiner Kücker - 08 Dec 2005 20:33 GMT
Try:

<frameset onUnload="location.replace(self.location)">

@see:

http://www.k-faktor.com/kram/javascript.htm

http://www.k-faktor.com/kram/javascript/seite-3.htm

Signature

www.heinerkuecker.de

Monique Y. Mudama - 08 Dec 2005 21:00 GMT
> Right away, the best possible solution I have is to force the 'back'
> button to forward it to the current page. The JavaScript snippet I
> am using is:
>
><script language="JavaScript"> javascript:window.history.forward(1);
    ></script>

> Since I do not intend to allow the user to go back at all, I am
> wondering if there is a better way, like disabling the 'Back' button
> altogether. My quick research resulted in "NOTHING", but I just
> could not give up...any help?

Change your intention.  I hate sites that pull stupid crap like this.

Signature

monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

Mickey Segal - 08 Dec 2005 21:55 GMT
> Change your intention.  I hate sites that pull stupid crap like this.

Since this discussion happened to land in a Java group I will add a
Java-related comment.  Some Java applet developers have also expressed
frustration with the browser Back button, since users sometimes click the
Back button hoping to return to a previous screen in an applet, thus
destroying the applet.

One workaround that some developers have used is to run the applet interface
in a Java Frame popped up from the applet (popup blockers don't block the
Frame).  This does not fiddle with the browser Back button, but since the
program content is in a Frame the user does not assume mistakedly that the
Back button is for use within the applet.
Oliver Wong - 08 Dec 2005 22:06 GMT
>> Change your intention.  I hate sites that pull stupid crap like this.
>
[quoted text clipped - 9 lines]
> since the program content is in a Frame the user does not assume
> mistakedly that the Back button is for use within the applet.

   Unfortunately, they sometimes assume that since there is a new frame,
the Applet has somehow disassociated itself with the original browser
window, and that it is thus safe to navigate away from the page.

   The best bet, I think, is to use Java Web Start, and let the user
download and run the program locally.

   - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.