什么是XMLHttpRequest

简介: Ajax利用了一个已被内置在所有主流浏览器里的对象——XMLHttpRequest,来发送和接收HTTP请求响应。

Ajax利用了一个已被内置在所有主流浏览器里的对象——XMLHttpRequest,来发送和接收HTTP请求响应。

Ajax takes advantage of an object built into all modern browsers-the

XMLHttpRequest object-to send and receive HTTP requests and

responses. An HTTP request sent via the XMLHttpRequest object does

not require the page to have or post a <form> element. The “A” in Ajax

stands for “asynchronous”, which means that the       XMLHttpRequest

object's send() method returns immediately, letting the browser

processing of other HTML/JavaScript on the Web page continue while the

server processes the HTTP request and sends the response. While

asynchronous requests are the default, the reader can optionally send

synchronous requests, which halt other Web page processing until the page

receives the server's response.

Microsoft introduced the    XMLHttpRequest object as an ActiveX

object in Internet Explorer (IE) 5. Other browser manufacturers,

recognizing the object's utility, implemented the          XMLHttpRequest

object in their browsers, but as a native JavaScript object rather than as an

ActiveX object. In turn, recognizing the value and security in that

implementation type, Microsoft has recast the XMLHttpRequest in IE

7 as a window object property. Even when the implementation (and thus

invocation) details differ, all the browsers' implementations have similar

functionality and essentially identical methods. The W3C is working to

standardize the XMLHttpRequest object, releasing a working draft of

the W3C specification1.

This chapter discusses the   XMLHttpRequest object API in detail,

listing and explaining all the properties and methods.

相关文章
|
16天前
|
Web App开发 XML JavaScript
XMLHttpRequest 对象
10月更文挑战第1天
|
3月前
|
前端开发 JavaScript API
js【详解】ajax (含XMLHttpRequest、 同源策略、跨域、JSONP)
js【详解】ajax (含XMLHttpRequest、 同源策略、跨域、JSONP)
48 0
|
5月前
|
XML 前端开发 JavaScript
AJAX - 创建 XMLHttpRequest 对象
AJAX - 创建 XMLHttpRequest 对象
|
XML Web App开发 缓存
一、所谓“神秘”的XMLHttpRequest对象
一、所谓“神秘”的XMLHttpRequest对象
289 0
|
XML JavaScript 前端开发
第108天:Ajax中XMLHttpRequest详解
在Ajax应用程序中,XmlHttpRequest对象负责将用户信息以异步通信地发送到服务器端,并接收服务器返回的响应信息和数据。    XMLHttpRequest可以提供不重新加载页面的情况下更新网页,在页面加载后再客户端向服务器请求数据,在页面加载后在服务器端接收数据,在后台向客户端发送数据。
1537 0
|
XML JavaScript 前端开发
|
Web App开发 iOS开发