javascript backspace by default problem…Going back a page

后端 未结 1 1443
礼貌的吻别
礼貌的吻别 2021-01-29 05:11

http://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 ha

相关标签:
1条回答
  • 2021-01-29 05:42

    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.

    0 讨论(0)
提交回复
热议问题