jquery的jsonp
1 <body> 2 <button id="btn">点击</button> 3 <script src="js/jquery.js"></script> 4 <script> 5 $(function () { 6 $('#btn').click(function () { 7 $.ajax({ 8 type: "get", 9 url: "http://localhost:3000/", 10 dataType: 'jsonp', 11 jsonp: 'callback',//键 12 jsonpCallback: 'acb',//值 13 success: function(data){ 14 console.log(data); 15 } 16 }); 17 }); 18 }); 19 </script> 20 </body>