469,920 Members | 2,323 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,920 developers. It's quick & easy.

capture back button on the IE toolbar..

43
hi
using javascript i am able to capture the backspace key and also to disable it but it is not working for the back button on the toolbar. i am new to javascript
have searched a lot but didnt got success.... the code i have written is like this

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. <!--
  3. window.document.onkeydown = Backkeyhandler;
  4.  
  5. function Backkeyhandler() {
  6.     if (window.event && window.event.keyCode == 8) {
  7.  
  8.          // alert("BackSpace Pressed !!");
  9.           return false;
  10.     }
  11. }
  12. //-->
  13. </script>



could any body please provide me the links or suggestion on how to capture the back button and if it works for IE only then also it is fine for me...
Feb 6 '08 #1
1 2265
acoder
16,027 Expert Mod 8TB
Why would you want to disable the back button? There may be an alternative.

If it's for a web application where the user would lose unsaved work, use onbeforeunload.
Feb 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ashvin Navare | last post: by
9 posts views Thread by jcnews | last post: by
1 post views Thread by Peter D. Dunlap | last post: by
5 posts views Thread by ewillyb | last post: by
2 posts views Thread by Vani Donthula | last post: by
7 posts views Thread by Lit | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.