Home  >  Article  >  Web Front-end  >  Solutions to avoid meaningless page refreshes caused by the Enter key_javascript techniques

Solutions to avoid meaningless page refreshes caused by the Enter key_javascript techniques

WBOY
WBOYOriginal
2016-05-16 18:08:061179browse

Carefully analyze such a page and generally meet the following conditions:
1. Contains a FORM form
2. Only one text box
This problem can be solved. Just destroy any one of the conditions. The general approach is Add a hidden text box
Of course, you can also add an onsubmit event after the form and return false to prevent the form from being submitted.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn