pro_cessor

XML Request

Apr 5th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    function get(url, callback) {
  2.         var request = new XMLHttpRequest();
  3.         request.open('GET', url, true);
  4.         request.onreadystatechange = function() {
  5.             if(this.readyState == 4) {
  6.                 if(this.status == 200) {
  7.                     callback(this.responseText);
  8.                 }
  9.             }
  10.         }
  11.         request.send(null);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment