Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. var root2 = 'https://jsonplaceholder.typicode.com';
  2. $.ajax( {
  3. url: root2 ,
  4. method: 'GET',
  5. success: function(response) {
  6. for(i=0;i<response.length;i++){
  7. jQuery.get('/posts',function(posts){
  8. for(var i=0;i<posts.length;i++){
  9. jQuery.get('/posts/' + i + '/comments', function(comments){
  10. document.write(comments[i].body);
  11. });
  12. }
  13. });
  14. }}});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement