Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

xmlhttprequest js

var url = "https://jsonplaceholder.typicode.com/posts";

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();
 
PREVIOUS NEXT
Tagged: #xmlhttprequest #js
ADD COMMENT
Topic
Name
8+3 =