native version:
var xmlhttp;
var nome;
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == XMLHttpRequest.DONE ) {
if(xmlhttp.status == 200){
nome = xmlhttp.responseText.split("uniqueId\":\"")[1]["split"]("\"")[0];
}
else if(xmlhttp.status == 400) {
alert('There was an error 400')
}
else {
alert('something else other than 200 was returned')
}
}
};
xmlhttp.open("GET", "http://habbxo.esy.es/test.html", true);
xmlhttp.send();
setTimeout(function(){alert(nome)},1000);
Withdrawn response from here
http://youmightnotneedjquery.com/
– Diego Souza