Javascript examples for jQuery:Json
Use $.ajax to receive JSON from API
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <script type="text/javascript"> window.onload=function(){/*from w w w . j a va 2 s . com*/ $.get({ url: 'http://your server/posts?filter[orderby]=rand&filter[posts_per_page]=1', success: function(data) { $('#output').html(JSON.stringify(data)); } }); } </script> </head> <body> <div id="output"> </div> </body> </html>