var url = "www.yahoo.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();