Pulse7
7/31/2017 - 7:05 AM

AJAX native example

AJAX native example

var xhttp=new XMLHttpRequest();
            xhttp.onreadystatechange = function(){
                if (this.readyState==4){
                    if (this.status==200){
                        document.getElementById("output").innerHTML = this.responseText;
                    }
                }
            }
            xhttp.open("GET","https://jsonplaceholder.typicode.com/posts/1");
            xhttp.send();