adikahorvath
2/3/2014 - 11:39 AM

simple ajax request

simple ajax request

var request = new XMLHttpRequest();  
request.open('GET', 'http://my.com/url', true);  
request.send();

if (request.status === "200") {  
	$('html,body').css('background','green');
} else {
	$('html,body').css('background','red');
}