Answers for "how to make a get request in javascript"

2

Javascript Http Get Request

const Http = new XMLHttpRequest();
const url='https://jsonplaceholder.typicode.com/posts';
Http.open("GET", url);
Http.send();

Http.onreadystatechange = (e) => {
  console.log(Http.responseText)
}
Posted by: Guest on September-14-2020
2

GET req with js

function httpGet(theUrl) {
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
    xmlHttp.send( null );
    return xmlHttp.responseText;
}
Posted by: Guest on August-04-2020
1

http request javascript

function httpGetAsync(url, callback) {
  var xmlHttp = new XMLHttpRequest();
  xmlHttp.onreadystatechange = function() { 
    if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
      callback(xmlHttp.responseText);
  }
  xmlHttp.open("GET", url, true); // true for asynchronous 
  xmlHttp.send(null);
}
Posted by: Guest on May-20-2020
1

Javascript make HTTP request

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Posted by: Guest on August-03-2021
-1

Javascript make HTTP request

xhr.open(Method, URL[, Async]);
JavaScriptCopy
Posted by: Guest on August-03-2021
-1

Javascript make HTTP request

const xhr = new XMLHttpRequest();
JavaScriptCopy
Posted by: Guest on August-03-2021

Code answers related to "how to make a get request in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language