码迷,mamicode.com
首页 > 编程语言 > 详细

【javascript】jquery jsonp跨越请求

时间:2014-06-28 11:57:17      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   java   color   get   

 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跨越请求

标签:style   blog   http   java   color   get   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!