JS跨域:No 'Access-Control-Allow-Origin' header is present on the requested resource

xiaoxiao2021-02-28  125

JS跨域

调用get请求的web接口返回错误:No ‘Access-Control-Allow-Origin’ header is present on the requested resource.默认是不允许跨域调用。

解决方案:使用jsonp格式 $.ajax({ url: url, type: "GET", dateType: "JSONP", success: function(result) { } });
转载请注明原文地址: https://www.6miu.com/read-37977.html

最新回复(0)