javascript - Can making an http request in a non-browser environment such as nodejs be called ajax?
给我你的怀抱
给我你的怀抱 2017-05-31 10:41:45
0
2
1253

AJAX stands for "Asynchronous JavaScript and XML" (asynchronous JavaScript and XML technology)

给我你的怀抱
给我你的怀抱

reply all(2)
洪涛

Generally speaking, we only turn XHR (XMLHttpRequest) requests into ajax.

But when fetch was released, we generally called xhr-based network requests traditional ajax to distinguish fetch (fetch is not based on
xhr).

Let’s look at the description of 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.

The meaning behind is: Asynchronously obtain resources across the network.

Maybe there will be no such thing as ajax in the future. After all, there is no x in ajax.

滿天的星座

Two of them on wiki

  1. AJAX stands for “Asynchronous JavaScript and XML”

  2. Ajax does not require any browser plug-ins, but requires the user to allow JavaScript to execute on the browser.

So it’s not called ajax


mdn also specifically pointed out that the most important thing in jax is the 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.

It also shows that it is not considered ajax in other environments. This should be just an ordinary http request, similar to a browser making a request to access a website.


wiki: https://zh.wikipedia.org/wiki...
mdn: https://developer.mozilla.org...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template