开发者

does xmlhttprequest = ajax (results from ajax only)

开发者 https://www.devze.com 2023-02-09 08:15 出处:网络
When I hear people talking about xmlhttprequest or XHR, does it basically mean an ajax call like this, or are there \"additional ways\" to get xmlhttprequest without using ajax?

When I hear people talking about xmlhttprequest or XHR, does it basically mean an ajax call like this, or are there "additional ways" to get xmlhttprequest without using ajax?

$.ajax({
  url: 'http://site.com/page'开发者_开发问答,
  type: 'POST',
  data: { input: 'input' },
  success: function(resp) {
  }
});


Short answer, yes. Long answer, not even close.

$.ajax is a wrapper to the XHR objects which have different APIs depending on the browser. (FFx, Safari, IE, etc).

eXternalHttpRequest.

Ajax, is Asyncrious Javascript And Xml. (The technical name can vary from person to person. )

Will $.ajax perform the same function as the XHR object? Yes, it is wildly used wrapper and a safe alternative to writing the XHR code to handle each browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号