Welcome aboard! We are happy you are here and wish you good net-raft!
function myfunc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("test").innerHTML = this.responseText;
}
};
xhttp.open("GET", "file.txt", true);
xhttp.send();
}  
The most helpful AJAX solutions
How to call php file using javascript ajax ?AJAX Click to see more ... 718 54