Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. var url = 'works.json';
  2. var XHR = ("onload" in new XMLHttpRequest()) ? XMLHttpRequest :
  3. XDomainRequest;
  4. var xhr = new XHR();
  5. xhr.open('GET', url, true);
  6. xhr.onload = function() {
  7. console.log(JSON.parse(this.responseText));
  8. }
  9. xhr.send();
  10.  
  11. $.getJSON('works.json', function(data){
  12. console.log(data);
  13. });
  14.  
  15. chrome.exe --allow-file-access-from-files --disable-web-security
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement