-1

I want to send an async HTTP request from the HTML, parse a response, and update an HTML page respectively. Is there a way to do it without using AJAX or any other third-party library?

I'd like to find the most basic way to do this. Since libraries can do it, it should be possible without them too.

Worth saying, that I'm a mobile developer who checks web development for a couple of days.

UPDATE 1

I didn't have to call AJAX a "third-party library". My bad.

UPDATE 2

Thanks everybody who responded. What I've learned: the only way to do what I wanted is AJAX, in particular, XMLHttpRequest.

7
  • Ajax is the name given to the process of "Making an HTTP request with JavaScript without leaving the current page". You can't do it without Ajax because they are the same thing. Ajax is not a third party library. Anything you can do with a library you can do without one because a library is just "JavaScript that someone else wrote". Commented Oct 7, 2016 at 11:30
  • You want it to be asynchronous but don't want AJAX? That is kind of weird, since AJAX literally means "Asynchronous Javascript and XML" (although you can ignore the XML part) Commented Oct 7, 2016 at 11:30
  • Here you have got browser api docs developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest Commented Oct 7, 2016 at 11:30
  • With ajax only you can if you dont want to use jquery ajax you can always opt for promise Commented Oct 7, 2016 at 11:31
  • @AatifBandey — That makes no sense at all. A promise isn't a way to make an HTTP request. Commented Oct 7, 2016 at 11:32

1 Answer 1

1

There is no way without JS. The most basic way is to either use the new fetch() API, or good old XMLHttpRequest() link

Sign up to request clarification or add additional context in comments.

8 Comments

This link is also good ;) : davidwalsh.name/fetch
Please avoid link only answers. Answers that are "barely more than a link to an external site” may be deleted.
Technically it is possible to request external resources without JS, but not to accomplish what the OP wants to do...but in case anyone is curious: webcomponents.org/articles/introduction-to-html-imports
I didn't say it should be without JS, just without libraries.
Than, you have two options listed above.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.