parsing JSON from ajax call - Javascript jQuery

Javascript examples for jQuery:Json

Description

parsing JSON from ajax call

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <!-- React --> 
  <script src="https://code.jquery.com/jquery-3.1.0.js"></script> 
 </head> /*from ww w .  j a  va  2s. c o  m*/
 <body> 
  <div id="tform"></div> 
  <script>
$(document).ready(function(){
  $.getJSON('http://reqres.in/api/users?page=2', function(json) {
    $( '#tform').append( '<div class="name">'+ json.data[1].first_name + ' ' + json.data[1].last_name + '</div>');
  });
});

      </script>  
 </body>
</html>

Related Tutorials