The difference between Ajax submission and traditional form submission _javascript tips

Source: Internet
Author: User

Ajax submission is through JS to submit the request, the request and response by the JS engine to deal with, the page will not refresh, the user does not feel the actual browser issued a request. For example, we want the page to always show the latest news, but do not want to always click the Refresh button, we can use the AJAX mechanism to implement. Online customer service software is also a better example of AJAX requests. The traditional request page will be refreshed, so the limitations are great.

1. Why use Ajax?
With Ajax, the user experience with the web is more "agile": The data submission page does not splash, the page is updated faster, and the network bandwidth is low.

2.AJAX development compared to the traditional mode of the simple place:
In traditional mode, the form submission is redrawn across the page, and more code is needed to keep the page users from changing the form's status. To pass more parameters between the controller and the template to keep the page state. And Ajax is not, because the page is only local update, do not care about the other parts of the page will not affect the content.

3.AJAX development is more difficult than traditional mode:
Need to understand, proficient JavaScript, and JavaScript there are debugging trouble, browser compatibility, and many other obstacles.

=================================

There are several differences:
1. Ajax in the submission, request, receive, are asynchronous, the Web page does not need to refresh; form submission is to create a new page, even if it is submitted to its own page, but also need to refresh;

2. a creates a new request in the background at the time of submission, and the F is to discard this page and then request;

3. A must use JS to achieve, do not enable JS Browser, can not complete the operation; F is the browser's instinct, whether or not to open JS, can submit a form; 4. A when submitting, requesting, receiving, the whole process needs to use a program to process its data; F commits, it is automatically completed according to your form structure, without code intervention.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.