IrfanT Posted December 15, 2020 Share Posted December 15, 2020 <script src="https://www.cs.kent.ac.uk/people/staff/yh/co539/A2-data/hygiene.php"></script> <script> $(document).ready(function(){ $.get("hygiene.php", function(data, status){ }); }); </script> Link to comment Share on other sites More sharing options...
Sherin Posted December 17, 2020 Share Posted December 17, 2020 var response = "[{ "Name":"Xyz", "Age":"16", "ID":"5" }, { "Name":"ABC", "Age":"15", "ID":"6" }]"; // convert string to JSON response = $.parseJSON(response); $(function() { $.each(response, function(i, item) { var $tr = $('<tr>').append( $('<td>').text(item.Name), $('<td>').text(item.Age), $('<td>').text(item.ID) ); //.appendTo('#records_table'); console.log($tr.wrap('<p>').html()); }); }); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now