Ajax---4.5 Learning Diary

Source: Internet
Author: User

What is Ajax
Asynchronous JavaScript and XML (asynchronous JavaScript and XML)
Save user action, time, improve user experience, reduce data requests
Transfer FETCH data
Using Ajax
Using Ajax to get the contents of a text file
An explanation of the AJAX process
Create Object XMLHttpRequest ()
Date () object
ActiveXObject (' Microsoft.XMLHTTP ')

Form
What is a form
Submit data to the server, such as: Submit user Information
Where is the action submitted
Method Submission Methods
The difference between get and post
Differences in transmission modes
Get transmitted via URL address
Post via browser internal transfer
Amount of data transferred
Get has data volume limits, and each browser is different
Post theoretically Unlimited

Reception of Back-end data
$_get
-An array of variables passed to the script by URL
$_post
-An array of variables passed to the script via the HTTP POST method (form)
Front and rear key names and transmission must be consistent
Data transfer method
Data acquisition methods

Open method
Three the meaning of a parameter
1. Submission Method Form-method
2. Submit Address Form-action
3. Asynchronous (synchronous)
Send method
Send data request, equivalent to form's submit

Request Status Monitoring
onReadyStateChange Events
ReadyState Properties: Request Status
0 (initialization) has not yet called the Open () method
1 (load) the Send () method is called and the request is being sent
2 (loading complete) the Send () method completes and all responses have been received
3 (parsing) parsing response content
4 (complete) The response content resolution is complete and can be invoked on the client
Status property: The state of the server (requesting resources)
What's returned
ResponseText: Returns content that is stored as text
Responsexml: Returns the content in XML form

Writing Ajax

Send request (difference between get and post)
Send (data to be sent): Sending a request
Chinese code
Cache
Post:setrequestheader (type, content): Set request Header
"Content-type", "application/x-www-form-urlencoded"
Data type (processing of returned data)
The real data that the server returned to us
XML, HTML, JSON
The notation of JSON
Where to look when Eval parses JSON
Json.parse (): string parsed into Object

Ajax---4.5 Learning Diary

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.