将jQuery帖子发送到Google API的Access-Control-Allow-Origin错误

将jQuery帖子发送到Google API的Access-Control-Allow-Origin错误,第1张

将jQuery帖子发送到Google API的Access-Control-Allow-Origin错误

我解决了将dataType参数修改为 dataType:’jsonp’添加 crossDomain:true 的Access-Control-
Allow-Origin错误 __

$.ajax({    url: 'https://www.googleapis.com/moderator/v1/series?key='+key,    data: myData,    type: 'GET',    crossDomain: true,    dataType: 'jsonp',    success: function() { alert("Success"); },    error: function() { alert('Failed!'); },    beforeSend: setHeader});


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4974503.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-13
下一篇 2022-11-14

发表评论

登录后才能评论

评论列表(0条)

保存