ajax1-php (27)

Source: Internet
Author: User
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.

  • 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.