jsonp跨域请求
来源:互联网 发布:广州多想网络 骗 编辑:程序博客网 时间:2024/05/18 17:26
http - 无状态(cookie session 防止获取操作)-同源策略-不同的来源信息不共享
标题www.testaaa.com
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="jquery.1.12.min.js"></script><script> $(function(){ $("button").click(function(){ var username=$('#username').val(); $.ajax({ type:'get', url:'http://www.testbbb.com/info.php', dataType: 'jsonp', jsonp: 'callback', //回调 jsonpCallback:'fun',//函数名 data: {username:username}, success:function(res){ alert(res); //object } }) }); })</script></head><body><center> <table border="1"> <tr> <td><input type="text" name="username" id="username"/></td> </tr> <tr> <td><button>submit</button></td> </tr> </table></center></body></html>
www.testbbb.com/info.php
<?php echo $_GET['callback'].'('.json_encode(array('success'=>1)).')';?>
阅读全文
0 0
- jsonp跨域请求
- jsonp 跨域请求
- jsonp跨域请求
- jsonp跨域请求
- jsonp跨域请求
- jsonp跨域请求
- JSONP 跨域请求
- jsonp跨域请求
- jsonp跨域请求
- JSONP跨域请求
- JsonP跨域请求
- jsonp跨域请求
- 跨域请求jsonp
- jsonp跨域请求
- JsonP跨域请求
- 跨域请求jsonp
- jsonp 跨域请求
- Jsonp跨域请求
- C#实例化一个对象的方法
- redis-整数集合
- 18. 4Sum
- 1. 线性结构--线性表
- 设计模式之装饰模式
- jsonp跨域请求
- 基于Qt的软件框架设计
- 分类模型的评估方法-正确率(Accuracy)
- 0. 基本概念
- python的xlrd&xlwt
- JFrame与Frame的区别
- 关于四旋翼往某个方向飘的问题
- Python正则表达式
- 索引_期刊_影响因子_分区