jQuery AJAX 超时未定义
我正在尝试示例 jQuery 示例,令我惊讶的是,我收到 AJAX 调用的错误状态,其中提到未定义超时。当我删除超时属性时,它工作得很好。 我几天前下载了 jQuery,所以我很确定这不是版本问题。
我尝试使用 Firefox(3.6.8) 而不是任何其他浏览器。
为什么会出现这种情况呢?
编辑:代码片段从评论移至问题
$.ajax({
type: "GET",
dataType: 'json',
url: PHPServiceProxy,
timeout: 5000,
success: function(reply) { } // note: original code snippet provided was missing a comma here.
error: function (xhr, textStatus, errorThrown) { }
});
I was trying out example jQuery examples and to my surprise, I got an error state for an AJAX call mentioning that timeout isn't defined. When I removed timeout attribute, it worked fine.
I downloaded jQuery few days back, so I am pretty sure it's not a version problem.
I was trying with Firefox(3.6.8) and not any other browser.
Why would this occur?
Edit: Code snippet moved from the comments to the question
$.ajax({
type: "GET",
dataType: 'json',
url: PHPServiceProxy,
timeout: 5000,
success: function(reply) { } // note: original code snippet provided was missing a comma here.
error: function (xhr, textStatus, errorThrown) { }
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
timeout
属性已经在 jQuery 中存在很长时间了,所以我认为你的问题与它无关。也许您的代码中有语法错误。这应该有效:The
timeout
property has been present in jQuery for a long time so I don't think that your problem is related to it. Maybe you have a syntax error in your code. This should work: