jsonp不能post!

1. jsonp的请求都为get

2. jsonp相当于loadJS, 返回的"数据"直接以js执行

$.ajax({
    url : "/static/get.php",
    data : {
        aa : "name"
    },
    type : "post",
    success : function(data){
        alert(data);
    }
})

抓包可以看到:

jsonp 的 post

请求:

http://xx/get.php?callback=jQuery17208796953377313912_1366782553589

但type:"get" 或 type:"post",dataType:"jsonp"时,一样都是get方式:

jsonp 的 post

请求:

http://xx/get.php?callback=jQuery17200924667939543724_1366782587492&aa=name&_=1366782587548

跨域需要jsonp时,只能用$_REQUEST获取参数

 

相关文章:

  • 2022-12-23
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2021-10-07
  • 2021-10-29
  • 2021-06-02
猜你喜欢
  • 2021-04-05
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案