Created
February 21, 2016 05:11
-
-
Save nmalkin/434688caa9209fbb1b14 to your computer and use it in GitHub Desktop.
CORS request example
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
</head> | |
<body> | |
<script> | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'https://archive.mozilla.org/pub/mobile/nightly/latest-mozilla-central-android-api-15/'); | |
xhr.onload = function() { | |
document.write(xhr.responseText); | |
}; | |
xhr.onerror = function(e) { | |
console.log('error!'); | |
console.log(e) | |
}; | |
xhr.send(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment