Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript Back button

 
Muhammad Sarwar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Is there any way in javascript to detect that the back button of browser has been pressed.
Actually I want to refresh my page whenever someone press the browser back button

Thanx,
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to tell the difference bewteen the back button, the closing of the page, user navigating away, or the refresh button.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic