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