gpt4 book ai didi

jquery - ajax 调用在 Firefox 和 chrome 中不起作用,但在 IE 中起作用

转载 作者:行者123 更新时间:2023-12-01 04:49:27 25 4
gpt4 key购买 nike

下面是在 $(document).ready 函数中调用的 javascript。在 IE 中它工作正常并返回记录,而在 Firefox 和 Chrome 中它给出错误。但错误没有给出任何细节。它只是说就绪状态= 0,状态=错误并且responseText为空。

var surl = serviceUrl + trainingService + "GetLastUpdateDate/";

$.ajax({
url: surl,
dataType: 'json',
success: function (data) {
alert("SUCCESS: " + data.d.length);
},
error: function (xhr, textStatus, error) {
alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
alert("responseText: " + xhr.responseText);
}
});

正如有人在下面的评论中询问的那样,这是 Firebug 调试器的屏幕截图,正如我之前提到的,它没有提供太多细节。

firebug watch window

最佳答案

我遇到了这个问题,因为我正在使用 <button onClick="doSomething()">button</button>这导致页面使用 <input type="button" onClick="doSomething()" value="button"/> 进行回发工作完美

关于jquery - ajax 调用在 Firefox 和 chrome 中不起作用,但在 IE 中起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22991480/

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