daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var xhr = new XMLHttpRequest();
  2. console.log("buscando cursos...xD");
  3.  
  4. //configurando a requisição para envio
  5. xhr.open("GET", "https://api-pacientes.herokuapp.com/pacientes");
  6.  
  7. xhr.addEventListener("load", function(){
  8.  
  9.     var conteudo = xhr.responseText;
  10.  
  11.     AQUI QUERIA UMA MANEIRA DE SETAR O VALOR DE UMA VARIAVEL HTML NO
  12.     ARQUIVO INDEX.HTML, SUPONHAMOS QUE TENHAMOS NO ARQUIVO INDEX.HTML A VARIAVEL
  13.     VAR RESPOSTA DECLARADA    
  14.  
  15.  
  16. });
  17.  
  18. //envia a requisição
  19. xhr.send();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top