My HTML page includes an ajax request that is functioning properly on Firefox, but does not work on Safari. While debugging, I noticed that the readystate is undefined and the status is "". Can anyone suggest why it might not be working on Safari?
Javascript Code:
<script>
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "pegSolitaireSettings.html", true);
xhttp.send();
}
function reloadGame() {
location.reload();
}
</script>
HTML Code:
<div id="demo">
<button type="button" onclick="loadDoc()">Settings</button>
<div class="center-div">...</div>
</div>