Solved

IE Browser back button capture using javascript

Posted on 2008-10-09
3
1,098 Views
Last Modified: 2009-06-16
I am looking for a java script snippet that can capture the use of the back button on IE, post a message to the user, and not allow the back action to take place
0
Comment
Question by:sladej
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:flipz
ID: 22679661
You can use the onbeforeunload event but may have it's limitations:
http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx
0
 

Author Comment

by:sladej
ID: 22679884
This works for any movement off the page.  We need something that will work if the back or fwd buttons are used only.
0
 
LVL 11

Accepted Solution

by:
flipz earned 250 total points
ID: 22679962
I am not aware of any events that only trap those conditions. If such an option was available - although I can think of many good uses for it - I can also imgaine some very irritating uses as well. Even though I cannot offer any more suggestions - I will be monitoring this post to see if a solution exists. Good luck.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question