The post of jquery that was found online

Source: Internet
Author: User

Url,[data],[callback],[type]
URL: Send request address.
Data: The Key/value parameter to be sent.
Callback: callback function when sending successfully.
Type: Returns the content format, XML, HTML, script, JSON, text, _default.

What is the difference between 1.get and post?
(1) The Get method transmits a small amount of data, high processing efficiency, low security, will be cached, and post instead.

(2) The Get access browser is considered to be idempotent.
is an identical URL, with only one result [the same is the exact match of the entire URL string].
So, when the second visit, if the URL string does not change, the browser is directly out of the results of the first visit.
Post is considered a variable access, and the browser thinks that the post submission must be changed.
Prevent idempotent access to get by adding "? +new Date () After the URL", [In short, the URL string for each access is different].
This principle should also be adhered to when designing Web pages.

2.AJAX garbled problem

Causes of garbled:
1, xtmlhttp the data returned by default character encoding is Utf-8, if the client page is gb2312 or other encoded data will produce garbled
2, Post method submission data The default character encoding is Utf-8, if the server side is gb2312 or other encoded data will produce garbled
The solutions are:
1, if the client is GB2312 encoding, the server specifies the output stream encoding
2, the server side and the client are using UTF-8 encoding
Gb2312:header (' content-type:text/html;charset=gb2312 ');
Utf8:header (' Content-type:text/html;charset=utf-8 ');

The post of jquery that was found online

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.