ar xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if( xhr.readyState == 4){ if( xhr.status >= 200 && xhr.status < 300 || xhr.status == 304){ info.innerHTML = xhr.responseText; } } }; xhr.open("get","test.txt",true); xhr.send(null);