gpt4 book ai didi

javascript - Safari 上的 JSONP 错误

转载 作者:行者123 更新时间:2023-12-03 06:54:31 24 4
gpt4 key购买 nike

以下 JSONP JQuery (v1.10.2) 调用适用于除 Safari 之外的所有浏览器:-

    $.ajax({
cache: false,
type: 'GET',
url: userExistsUrl,
dataType: 'json',
error: function (jqXHR, textStatus, errorThrown) {
var errText = 'We are not able to process your request at the moment (' + textStatus + ', ' + errorThrown + ')';
console.error('HTTP response : ' + jqXHR.status);
console.error(errText);
displayError(errText);
},
success: function (xml) { }
});

在 Safari 上,错误函数被调用,并且变量 textStatus 包含字符串“error”。但是,如果我选择开发人员菜单选项“禁用跨域限制”,则调用可以正常工作。

由于这只是一个标准的 JSONP 调用,我如何才能让它在 Safari 上工作而不调用开发人员选项?

最佳答案

您的数据类型错误

数据类型:'jsonp'

关于javascript - Safari 上的 JSONP 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37336470/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com