In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "what are the differences between form forms and ajax submissions". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the difference between form forms and ajax submissions.
Differences: 1, ajax submission is asynchronous, the web page does not need to be refreshed, and from form submission needs to be refreshed; 2, ajax must be implemented with js, but Form form is not a must; 3, ajax needs to use procedures for data processing, Form form submission is automatically completed according to the form structure, without code intervention.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
The difference between form form submission and ajax submission
1. Usage scenarios:
The security is the same, the http protocol is sent. Security is related to the business processing of submitted documents (format detection, anti-injection), and has nothing to do with the mode of submission.
General login with form submission, click submit to trigger submit events, generally make the page jump, page jump and other behavior control is often in the back-end, the back-end control of the page jump and data transfer; but sometimes do not want the page jump, or want to put control on the front end, through js to operate page jump or data change, generally this asynchronous operation, will use ajax.
But Ajax will have a hidden problem, that is, browsers do not save passwords, which is not in line with user habits. The ideal way: create a hidden iframe, point the target of the form tag to iframe, and then check the status of the iframe.
2. Compare:
(1) ajax in the submission, request, receive, are asynchronous, the page does not need to refresh, only refresh part of the page, do not care about and do not affect the content of other parts of the page.
Form submission is a new page that needs to be refreshed even if it is submitted to itself. In order to maintain the page user's state change to the form, more parameters should be passed between the controller and the template to maintain the page state.
(2) when ajax submits, it creates a new request in the background.
Form is to abandon this page and then request again.
(3) ajax must be implemented in js. There are debugging troubles, browser compatibility problems, and browsers that do not enable js can not complete the operation.
Form forms are included in the browser and can be submitted regardless of whether js is turned on or not.
(4) when ajax submits, requests and receives, the whole process needs to use the program to process the data.
Form form submission is done automatically according to the form structure and does not require code intervention. Submit in submit.
3. Other aspects:
With regard to the verification of input content, ajax can use the program to determine the content of the element obtained; the properties of the form form have verified fields, which are encapsulated in easyui,jeecg, and users only need to add the verification rules of regular expressions.
At this point, I believe you have a deeper understanding of "what is the difference between form forms and ajax submission". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.