1 <html> 2 <Meta http-equiv="Content-Type" Content="text/html; Charset=utf-8"> 3 4 <head> 5 <title>javascript页面</title> 6 7 <!--纯js--> 8 <script> 9 var flightHalder = function(data){ 10 alert("您查询的航班:" +data.price+ "元,余额:" +data.tickets+); 11 } 12 13 //提供jsonp的url地址 14 var url = "121212121212"; 15 16 // 动态生成script 17 var script = document.createElement("script"); 18 script.setAttribute("src",url); 19 document.getElementsByTagName("head")[0].appendChild(script); 20 </script> 21 22 <!--jquery--> 23 <script> 24 25 </script> 26 </head> 27 <body> 28 </body> 29 30 </html>