AJAX即“Asynchronous JavaScript and XML”(異步的JavaScript與XML技術(shù))
一般來(lái)說(shuō),我們只把 XHR(XMLHttpRequest) 的請(qǐng)求成為 ajax。
但是當(dāng) fetch 發(fā)布后,我們一般把基于 xhr 的網(wǎng)絡(luò)請(qǐng)求稱為 傳統(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.
后面的意思是:跨網(wǎng)絡(luò)異步獲取資源。
也許以后就沒有 ajax 這種說(shuō)法了。畢竟 ajax 中已經(jīng)沒有了 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.
也能說(shuō)明其他環(huán)境下不算是ajax了 這個(gè)應(yīng)該只是普通的http請(qǐng)求 跟瀏覽器發(fā)起請(qǐng)求來(lái)訪問(wèn)某個(gè)網(wǎng)站類似。
wiki: https://zh.wikipedia.org/wiki...
mdn: https://developer.mozilla.org...