【发布时间】:2012-10-11 23:53:33
【问题描述】:
超时有效!但是当超时时我想运行一个函数。你有什么想法吗?
$.ajax({
type: "GET",
url: "xajax.php",
timeout: 100,
data: "name=John&location=Boston",
success: function(msg){ alert( "Data Saved: " + msg ); }
【问题讨论】:
-
服务器是否返回
json...? -
没有响应就很难确定问题所在。大多数情况下,问题是错误的 json。可以在浏览器中转到
xajax.php?result=hello并添加对您问题的回复吗? -
响应是一个Javascript警告框“parseerror”