Reputation: 108
I've been trying to get this piece of AJAX program to run but it won't work on Chrome or Safari. It works on Firefox, though.
function myFunction() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("myID").innerHTML =this.responseText;
}
};
xhttp.open("GET", "myPage.php", true);
xhttp.send();
}
Upvotes: 0
Views: 666
Reputation: 96
Probably, It's the installed extensions that are messing it up!
Print the ready state and HTTP status code. You should be getting ready state 4 and status code 0 in chrome in this case.
Please read the answer by Lee in this post
Upvotes: 1