Created
July 17, 2015 23:50
-
-
Save GoesToEleven/02f6af5cb63e34347c19 to your computer and use it in GitHub Desktop.
AJAX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new XMLHttpRequest(); | |
request.open('GET', 'data.txt'); | |
request.addEventListener('readystatechange', function() { | |
if ((request.status === 200) && (request.readyState === 4)) { | |
myNode = document.querySelector('body'); | |
myNode.innerHTML = request.responseText; | |
console.log('new way'); | |
} //ready | |
}); | |
request.send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment