Disable back button of browser

179 views
Skip to first unread message

Maddy

unread,
Dec 21, 2012, 1:32:19 AM12/21/12
to rubyonra...@googlegroups.com
Hi Folks,

Good Day,

How to disable back button of browser??

Please advise!

Thank You.

Jim Ruther Nill

unread,
Dec 21, 2012, 1:34:00 AM12/21/12
to rubyonra...@googlegroups.com
On Fri, Dec 21, 2012 at 2:32 PM, Maddy <ashok...@shriramits.com> wrote:
Hi Folks,

Good Day,

How to disable back button of browser??

you cant.
 

Please advise!

Thank You.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/t_Pf7lwKLwAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

Jordon Bedwell

unread,
Dec 21, 2012, 1:35:06 AM12/21/12
to rubyonra...@googlegroups.com
On Fri, Dec 21, 2012 at 12:32 AM, Maddy <ashok...@shriramits.com> wrote:
> How to disable back button of browser??

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

Ashokkumar Yuvarajan

unread,
Dec 21, 2012, 2:10:51 AM12/21/12
to rubyonra...@googlegroups.com
Thanks!

Is there any another way??

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

Please advice!



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.



--
"Attitude is a little thing that makes a big difference"

Thanks & Regards
Ashokkumar.Y
ROR-Developer
email : ashok...@shriramits.com
Shriramits



Jordon Bedwell

unread,
Dec 21, 2012, 2:24:49 AM12/21/12
to rubyonra...@googlegroups.com
On Fri, Dec 21, 2012 at 1:10 AM, Ashokkumar Yuvarajan
<ashok...@shriramits.com> wrote:
> Is there any another way??
>
> My requirement is, once i clicks the browser back button my site redirect to
> home page.

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

Jim Ruther Nill

unread,
Dec 21, 2012, 2:33:49 AM12/21/12
to rubyonra...@googlegroups.com
On Fri, Dec 21, 2012 at 3:10 PM, Ashokkumar Yuvarajan <ashok...@shriramits.com> wrote:
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 :)
 



On Fri, Dec 21, 2012 at 12:05 PM, Jordon Bedwell <envy...@gmail.com> wrote:
On Fri, Dec 21, 2012 at 12:32 AM, Maddy <ashok...@shriramits.com> wrote:
> How to disable back button of browser??

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.



--
"Attitude is a little thing that makes a big difference"

Thanks & Regards
Ashokkumar.Y
ROR-Developer
email : ashok...@shriramits.com
Shriramits



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Rafi A

unread,
Dec 21, 2012, 5:33:47 AM12/21/12
to rubyonra...@googlegroups.com
Ashok,

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


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/t_Pf7lwKLwAJ.

Tim Slattery

unread,
Dec 21, 2012, 9:04:24 AM12/21/12
to rubyonra...@googlegroups.com
Rafi A <rafi...@gmail.com> wrote:

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

--
Tim Slattery
Slatt...@bls.gov

Scott Ribe

unread,
Dec 21, 2012, 9:41:49 AM12/21/12
to rubyonra...@googlegroups.com
On Dec 20, 2012, at 11:32 PM, Maddy wrote:

> How to disable back button of browser??

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.


--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




Matt Jones

unread,
Dec 21, 2012, 2:09:08 PM12/21/12
to rubyonra...@googlegroups.com


On Friday, 21 December 2012 02:10:51 UTC-5, Maddy wrote:
Thanks!

Is there any another way??

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

Please advice!


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 
Reply all
Reply to author
Forward
0 new messages