简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JSONP 范例</title> <script src="/static/js/jquery-1.8.3.min.js"></script> </head> <body> <div id="divCustomers"></div> <script> $.getJSON("/r/show/yufei/jsonp/python_cnt?jsonp=?",function(result){ var rs = result['data']; var html='<ul>'; for(var i=0; i<rs.length; i++) { html += '<li>'+rs[i]['lang']+':'+rs[i]['cnt']+'</li>'; } html += '</ul>'; $('#divCustomers').html(html); } ); </script> </body> </html>
运行结果: