Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Brower Back

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I would like to disable the browser back button IE and NE
Can anyone help me on the workarounds to implement the same.

Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It can not be done. Plus if the person has JavaScript disabled, they will be able to get around it.

You can look at expiring the page with server side.

Eric
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

One way of doing this is, put the code

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

in the page which comes before the actually page from where you don't want the users to go back.

And remember this will not work if javascript is disabled.

Thanks,
Jyothsna
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jyothsna,

Could you pls explain this point.

Cheers,
Swamy
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you goto the basics section of my site, there is a link that says back button, I have an explaination there that I have had for years...

http://www10.brinkster.com/A1ien51/basics/

Eric
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also interested in "disabling" the back button, but it does not seem to work with the latest version of FireFox. I've tried the following two lines, not at the same time, and they have worked with IE.



Jay
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. All those suggestions will not work if instead of just clicking on a back button I click on small arrow near it and pick previous entry from the list.
2. There are couple server/client side solutions, mostly working on two counters, one on a page and one in a session, counters increase on every request, if they out of sync you do something.
3. Another solution would be to have your page "self-contained". As an example, I had a project, where I would put variables into my hashmap instead of session, serialize hashmap to a string, than zip the string and put it into the page as a hidden variable and submit it with every request. This way you don't care about back button at all.
4. Somewere in this forum I posted a javascript code, that could determine if current page is result of reload or back button.
5. On a personal note, I found all those restriction for back button on some websites really annoying.
[ June 04, 2006: Message edited by: Yuriy Fuksenko ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic