Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var xhr = new XMLHttpRequest();
- xhr.open("GET", url, true);
- xhr.onload = function(e) {
- code = xhr.response;
- };
- xhr.onerror = function () {
- console.error("** An error occurred during the XMLHttpRequest");
- };
- xhr.send();
- function doTheThing(code) {
- // I hope the response is ready.
- }
Add Comment
Please, Sign In to add comment