Ajax knowledge Notes--Getting started, synchronous and asynchronous, XHR

Source: Internet
Author: User

Ajax Full Name: Asynchronous JavaScript and XML, asynchronous JavaScript and XML.

Ajax is not a language, it is a technology that can update parts of a Web page without reloading the entire page.

(interacting with the background for partial updates, asynchronous updates)

Synchronous and asynchronous :

synchronization (before the advent of Ajax): The client initiates the request, the server processes and responds to the request, during which time the client waits for a response from the servers, and the client re-loads the page after the server-side response, and if you have an error, you can only initiate the request again and wait ...

< Span style= "FONT-SIZE:14PX; line-height:28px ">

< Span style= "FONT-SIZE:14PX; line-height:28px "> async (after the advent of Ajax) : xmlhttprequest the appearance of the background and the server without reloading the page in the case of data exchange (and part of the Web page update).

< Span style= "FONT-SIZE:14PX; line-height:28px ">

xmlhttprequest

< Span style= "FONT-SIZE:14PX; line-height:28px "> Instantiating Xhr object:

" Pre code_snippet_id= "669033" snippet_file_name= "blog_20150518_1_9361936" name= "code" class= "HTML" style= " line-height:28px; " ><span style= "FONT-FAMILY:SIMSUN;FONT-SIZE:12PX;" >var request </span><span style= "Font-family:microsoft Yahei, Hiragino Sans GB, Helvetica, Helvetica Neue, Microsoft Jacob Black, Tahoma, Arial, sans-serif;font-size:14px; >= </span><span style= "FONT-FAMILY:SIMSUN;FONT-SIZE:12PX;" >new XMLHttpRequest (); </span>

< Span style= "FONT-SIZE:14PX; line-height:28px "> Consider browser compatibility:

var request;if (window. XMLHttpRequest) {request = new XMLHttpRequest ();//ie7+,firefox,chrome,opera,safari ...} Else{request = new ActiveXObject ("Microsoft.XMLHTTP");//IE6,IE5}


Ajax knowledge Notes--Getting started, synchronous and asynchronous, XHR

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.