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

R

Raj

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?
 
S

Steve W. Jackson

Raj said:
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?

The Javascript groups are elsewhere...
 
O

Oliver Wong

Steve W. Jackson said:
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
 
M

Monique Y. Mudama

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.
 
M

Mickey Segal

Monique Y. Mudama said:
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.
 
O

Oliver Wong

Mickey Segal said:
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.

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
 

Aji

Joined
Mar 8, 2010
Messages
1
Reaction score
0
prevent refresh actions while disabling back button

Hi,

while disabling the back button in IE using .js,It is refreshing the page.

but i dont want to refresh the page..

I have used:

<script type="text/javascript">
function noBack()
{
window.history.forward(1);
}
</script>

In body tag..

<body onLoad="noBack();>

Not working properly...

What i do



Oliver Wong said:
"Mickey Segal" <[email protected]> wrote in message
news:[email protected]...
> "Monique Y. Mudama" <[email protected]> wrote in message
> news:[email protected]...
>> 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.


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
 
Joined
Jan 27, 2010
Messages
27
Reaction score
0
Disabling right click in browser using JavaScript

Some times we need to disable the right click option in the web browser for security reason .The following code can be used to implement this functionality in the best way.
<script language ="javascript" >
function DisableRightClick()
{
if (event.button == 2)
{
alert("Right Click is not possible Here !")
}

}
.onmousedown=DisableRightClick;

</script >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top