Disable back button of browser

Hi Folks,

Good Day,

How to disable back button of browser??

Please advise!

Thank You.

Hi Folks,

Good Day,

*How to disable back button of browser??*

you cant.

You can't. It's the users browser, not yours.

Thanks!

Is there any another way??

My requirement is, once i clicks the browser back button my site redirect to home page.

Please advice!

The saying "it's more trouble than it's worth" is particularly fitting
in this situation.

Thanks!

Is there any another way??

Nope.

My requirement is, once i clicks the browser back button my site *redirect
to home page*.

Please advice!

If there is a way, this is not the forum to ask :slight_smile:

Ashok,

You can disable the browser back button with the help of JavaScript snippets:

I don't think so. This is in the FAQ in comp.lang.javascript, and the
answer is that it can't be done.

NO NO NO! 100 TIMES NO!

The back button is so fundamental to the experience of using a browser, that if your design needs it to be disabled, then your design is broken. Period. End of discussion.

As others have indicated, it’s tricky-to-impossible and considered seriously bad practice to do this sort of fiddling with the browser’s navigation.

A better question is, why does this need to happen? There’s a good chance that the need for this sort of behavior reflects a design smell someplace else - for instance, trying to maintain session state in the URL or similar.

–Matt Jones