javascript backspace by default problem....Going back a page
ht开发者_Go百科tp://pastebin.com/N82ma0HN
is my source code...
here is the page: http://dev.icalapp.rogersdigitalmedia.com.rogers-test.com/Edit.php
The issue I am having is when you type a list of phone numbers into the list and then when you click one to edit it, if you backspace to delete the number, it will mess the entire list up by going back one page....i am fully aware that this is because the default back page is backspace and thats why its doing that but I really want it to not backpage when I use backspace to delete a number from the list.....
So what I am saying basically is how can I disable backspace to backpage......
On the keyup event of the input, handle the keyCode and if it was a backspace, simply stub propagation (bubbling) by return false;
. When you backspace on an element, the keyup event is moved from the element to its parent, to its parent's parent, to its grandparent's parent element and so on. This is called bubbling. If you handle it, and return false;
, you declare that you don't want it (the event) to be passed to parents.
When a keyup reaches the body (or HTML, or document, or window), it fires window.history.prev() method, which moves one page back.
精彩评论