XMLHttpRequest与HttpRequest [英] XMLHttpRequest Vs HttpRequest
问题描述
有人知道XMLHttpRequest
可以使网页做什么吗,而普通的HttpRequest
不能做到?
Does anyone know, what an XMLHttpRequest
enables a web page to do, which cannot be done using a normal HttpRequest
?
推荐答案
XMLHttpRequest
一个标准的javascript对象,可让您使用javascript从浏览器发出HTTP请求.
XMLHttpRequest
in a standard javascript object that allows you to make HTTP Requests from the browser in javascript.
HttpRequest
是服务器端对象,代表对服务器的请求.
HttpRequest
is a server side object that represents a request to the server.
总而言之-一种在浏览器中工作,另一种在Web服务器中工作.他们还具有完全不同的角色. XMLHttpRequest
用于在浏览器中获取Web资源. HttpRequest
代表传入请求.
In summary - one works in the browser, the other in the web server. They also have completely different roles. XMLHttpRequest
is for fetching web resources within the browser. HttpRequest
represents an incoming request.
这篇关于XMLHttpRequest与HttpRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!