A Brief introduction
Web program working schematic diagram:
The traditional Web program working principle diagram:
Ajax working principle diagram:
1. About Ajax
L Asynchronous asynchronous
L JavaScript
L and
L XML
Ajax is a technology that leverages JavaScript to interact with XML and server data
Xml:
Json:
2. Development history
L 1998 Births
L 2005 Popularity
3. Operating Platform
L Google Chrome
L Mozilla
L Firefox
L Internet Explorer
L Opera
L Konqueror
L Safari
Ii. Core Objects
XMLHttpRequest
First, create the object
Under different browsers, the way you create Ajax objects is slightly different.
IE under:
New ActiveXObject ("Microsoft.XMLHTTP")
Web Model Browser:
New XMLHttpRequest ()
5. Encapsulating Ajax
Calling code:
Third, Ajax object-related properties and methods:
1. Related methods:
L Open (Method,url)
Initializing an Ajax object
Method: Request mode post, get
URL: Request Resource address
L setRequestHeader (Header,value)
Set Request header information
Header: Head information
Value: Values
L Send (content)
Send Request
Content: The parameters passed are only required to be placed in the POST request.
2. Related attributes:
L ReadyState
The status code of the Ajax object, the status code will change at any time
0: Indicates that the object is established but not initialized
1: Indicates that the object has been initialized but not sent
2: The Send method has been called for request
3: Receiving data (Received part)
4: Receive complete
L onReadyStateChange
When the status code of an Ajax object changes, the callback function that is triggered
L Status
HTTP response Status Code
L StatusText
Text of the HTTP response
L ResponseText
Text of the HTTP response content
L Responsexml
XML data for HTTP response content
There are three main ways to pass Ajax object data:
Text:responsetext
Xml:reponsexml
Json:responsetext
The above describes the ajax1-php (27), including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.