A problem that the project encounters
A normal web page, if there is no focus on this page, then click on the "Backspace" button, the page will be rolled back (backward to the previous page),
This will be a problem, when I entered in an input box, entered a number of characters, began to click the "Backspace" key to delete,
When the character in the text box is deleted, pressing the "Backspace" key reverses the previous page, but I don't want to go back to the previous page. So that users
The experience is very bad, and the user has to re-enter from the previous page.
Cause: When there is no focus on the page, clicking the "Backspace" button will return the page (this is a feature of the browser). When we are deleting
Enter the character of the box, when the deletion is finished, and then click on the "Backspace" key, the input box and the page will lose focus, then continue to click
The previous page is returned.
Workaround: We can define a KeyUp keyboard event function, which defines when the "Backspace" key is clicked, if the contents of the input box are empty,
Then keep getting the focus, and the input box will always hold the focus, so it won't go back to the previous page.
JS Disable the "Backspace" key (that is, prevent the page backwards)