Advertisement
ph4x35ccb

requisição ajax/js

Aug 29th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var myReq = new XMLHttpRequest();
  2. myReq.onload = function(){
  3.     console.log(JSON.parse(this.response));
  4.     var conteudo = this.response;
  5.     document.querySelector('.git-content').innerHTML=conteudo;
  6. }
  7. myReq.open('get','https://api.github.com/search/repositories?q=PHP', true);
  8. myReq.send()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement