Guest User

Untitled

a guest
Feb 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. var xhr = new XMLHttpRequest();
  2. xhr.open("GET", url, true);
  3. xhr.onload = function(e) {
  4. code = xhr.response;
  5. };
  6. xhr.onerror = function () {
  7. console.error("** An error occurred during the XMLHttpRequest");
  8. };
  9. xhr.send();
  10.  
  11. function doTheThing(code) {
  12. // I hope the response is ready.
  13. }
Add Comment
Please, Sign In to add comment