AJAX即“Asynchronous JavaScript and XML”(異步的JavaScript與XML技術)
一般來說,我們只把 XHR(XMLHttpRequest) 的請求成為 ajax。
但是當 fetch 發(fā)布后,我們一般把基于 xhr 的網絡請求稱為 傳統(tǒng) ajax,用于區(qū)分 fetch(fetch 不是基于
xhr)。
我們看 fetch 的描述:
The Fetch API provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. It also provides a global
fetch()
method that provides an easy, logical way to fetch resources asynchronously across the network.
后面的意思是:跨網絡異步獲取資源。
也許以后就沒有 ajax 這種說法了。畢竟 ajax 中已經沒有了 x。
wiki上其中兩句
AJAX 即 “Asynchronous JavaScript and XML”
Ajax不需要任何瀏覽器插件,但需要用戶允許JavaScript在瀏覽器上執(zhí)行。
所以不叫 ajax
mdn 上也特別指出了jax里最重要的是 XMLHttpRequest object
Asynchronous JavaScript + XML, while not a technology in itself, is a term coined in 2005 by Jesse James Garrett, that describes a "new" approach to using a number of existing technologies together, including: HTML or XHTML, Cascading Style Sheets, JavaScript, The Document Object Model, XML, XSLT, and most importantly the XMLHttpRequest object.
也能說明其他環(huán)境下不算是ajax了 這個應該只是普通的http請求 跟瀏覽器發(fā)起請求來訪問某個網站類似。
wiki: https://zh.wikipedia.org/wiki...
mdn: https://developer.mozilla.org...