简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JSONP 范例</title> </head> <body> <div id="divCustomers"></div> <script> function callbackFunction(result,methodName) { 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>'; document.getElementById('divCustomers').innerHTML=html; } </script> <script src="/r/show/yufei/jsonp/python_cnt?jsonp=callbackFunction&t=11"></script> </body> </html>
运行结果: