Guest User

Untitled

a guest
May 26th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function * getData(url){
  2. var xhr = new XMLHttpRequest();
  3. xhr.open('GET', url, true);
  4.  
  5. xhr.onload = function * () {
  6. yield this.response;
  7. };
  8.  
  9. xhr.send();
  10. };
  11.  
  12. var d = getData('/mydata');
  13.  
  14. console.log(d)
Add Comment
Please, Sign In to add comment