My code in my HTML file:
<!doctype html>
<head>
<title>Notes</title>
<script>
function PullNotes() {
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "notes.txt", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4 || txtFile.status == 200) {
allText = txtFile.responseText;
}
document.getElementById('notetext').innerHTML = allText;
}
}
</script>
</head>
<body>
<div id="notetext"><p>Failed.</p></div>
<input type="button" value="Pull Notes" onClick="PullNotes()">
</body>
</html>
When I click the button. Nothing happened.
If you're wondering why it says "Failed" it's so I know that the JavaScript didn't update.
Thanks, ~BN