1. 从url拿json
2.处理response的json
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <title>jsonp sample</title> </head> <body> <div id="gists"> </div> <script> $(document).ready(function(){ $.getJSON('https://api.github.com/gists?callback=?',function(response){ $.each(response.data,function(i,gist){ $('#gists').append('<li>' + gist.comments_url); }); }); });</script> </body> </html>原文链接:https://www.f2er.com/json/289822.html