var xhr; xhr = new XMLHttpRequest(); xhr.open("GET", "http://myurl.php", true); xhr.timeout = 10000;