【javascript】jquery jsonp跨越请求
2014-06-20 10:30
309 查看
<html> <head> <meta charset="utf-8"> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"> </script> <script type="text/javascript"> $(document).ready(function() { $("input[type=button]").click(function() { //begin $.ajax({ url: 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q='+$("#keywords").val(), type: 'get', dataType: 'jsonp', jsonp:"callback", jsonpCallback:"aa", }) // end }); }); function aa(data){ alert(data.results['url']) } </script> </head> <body> <input type="text" name='keywords' id="keywords"/><br/> <input type="button" value="查询"/> <p id="content"></p> </body> </html>
相关文章推荐
- js/ajax跨越访问-jsonp的原理和实例(javascript和jquery实现代码)
- js/ajax跨越访问-jsonp的原理和实例(javascript和jquery实现代码)
- js/ajax跨越访问-jsonp的原理和实例(javascript和jquery实现代码)
- 跨域请求之jQuery的ajax jsonp的使用解惑
- 跨域请求之jQuery的ajax jsonp的使用解惑
- 跨域请求之jQuery的ajax jsonp的使用解惑
- jQuery 之ajax jsonp跨域请求学习笔记
- 使用jquery以jsonp方式在gbk页面请求utf-8编码的数据
- jquery中使用jsonp请求数据
- 跨域Ajax请求(jQuery JSONP MVC)
- jquery+ajax+jsonp实现跨域请求
- 说说JSON和JSONP,也许你会豁然开朗,含jQuery用例 分类: JavaScript 2014-09-23 10:41 219人阅读 评论(1) 收藏
- jquery中jsonp的ajax请求
- js/ajax跨域访问—jsonp的原理和实例(javascript和jquery)
- jQuery下ajax发起jsonp请求过程
- 跨域请求之jQuery的ajax jsonp的使用解惑
- javascript jquery php 中ajax请求其他页面(ajax jqXHR curl)跨域
- jQuery Django JSON JSONP /Work togeter/ (JavaScript Python JSON HTML5)
- 跨域请求之jQuery的ajax jsonp的使用解惑
- jquery的ajax跨域请求jsonp解决方法