我试图让这段代码工作,但它给了我一个错误。它似乎没有执行。
jQuery.post("getResults.php", {id:id} , function(data)
{
jQuery("select#kDate").removeAttr("disabled");
jQuery("select#kDate").html(data);
})
.success(function() { alert("second success"); })
.error(function() { alert("error"); })
.complete(function() { alert("complete"); });
});
任何帮助都将不胜感激。
答案 0 :(得分:3)
错误功能有3个参数......
error(jqXHR, textStatus, errorThrown)
试试这个:
error(function(xhr, status, detail) { alert("error ("+status+") : " + detail); });
答案 1 :(得分:0)
试试这个:你也可以看到here。
var id = "some-value";
jQuery.post("getResults.php?id="+id, function(data) {
jQuery("select#kDate").removeAttr("disabled");
jQuery("select#kDate").html(data);
})
.success(function() { alert("second success"); })
.error(function() { alert("error"); })
.complete(function() { alert("complete"); });