Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var author=document.getElementById("author");
- var quote=document.getElementById("quote");
- var request=new XMLHttpRequest();
- request.open('GET', 'http://talaikis.com/api/quotes/random/');
- request.onload=function(){
- console.log(request.responseText);
- var data=JSON.parse(request.responseText);
- test(data);
- }
- request.send();
- function test(thing){
- var quoteString="";
- quoteString+=thing.quote;
- console.log("Quote inside the function test : " +quoteString);
- quote.insertAdjacentHTML("afterbegin", quoteString);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement