调用web接口,get请求,发现提示:No 'Access-Control-Allow-Origin' header is present on the requested resource.

这个和安全机制有关,默认不允许跨域调用

调用web接口跨域问题

 

处理手段:使用jsonp格式, ajax请求参数dataType:'JSONP'。

 

 

$.ajax({
        url: "http://.......",
        type: 'GET',
        dataType: 'JSONP',//here
        success: function (data) {
 

        }
    });

  


相关文章:

  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-08
  • 2021-09-14
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-07-20
相关资源
相似解决方案