Javascript examples for jQuery Method and Property:ajax
Passing Variable From Ajax to Javascript
<html> <head> <title>AJAX JSON Example</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script> $(function(){//from w ww .j av a 2 s .c om $.getJSON('ajax.php',function(data){ $.each(data,function(index,value){ $('body').append('Name: ' + value.name + ' | City: ' + value.city + '<br />'); }) }); }); </script> </head> <body> </body> </html>