Answers for "xhr"

0

XHR

var url = "https://example.com/";

var xhr = new XMLHttpRequest();
xhr.open("GET", url);

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

xhr.send();
Posted by: Guest on June-11-2021
0

xhr

xhttp.open("POST", "demo_post2.asp", true);

 xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

 xhttp.send("fname=Henry&lname=Ford");
Posted by: Guest on May-05-2021

Browse Popular Code Answers by Language