首页 > 编程语言 > 详细

【javascript】jquery jsonp跨越请求

时间:2014-06-28 11:55:06      阅读:351      评论:0      收藏:0      [点我收藏+]
 1 <html>
 2     <head>
 3         <meta charset="utf-8">
 4         <title></title>
 5         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
 6 </script>
 7 <script type="text/javascript">
 8    $(document).ready(function() {
 9     $("input[type=button]").click(function() {
10    //begin
11         $.ajax({
12              url: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=+$("#keywords").val(),
13              type: get,
14              dataType: jsonp,
15              jsonp:"callback",
16              jsonpCallback:"aa",
17          })
18         // end
19 
20     });
21          
22    });
23    function aa(data){
24     alert(data.results[url])
25 
26    }
27 </script>
28     </head>
29     <body>
30     <input type="text" name=‘keywords‘ id="keywords"/><br/>
31     <input type="button"  value="查询"/>
32 <p id="content"></p>
33     </body>
34 </html>

 

【javascript】jquery jsonp跨越请求,布布扣,bubuko.com

【javascript】jquery jsonp跨越请求

原文:http://www.cnblogs.com/tl542475736/p/3798792.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!