我知道我的標題不是很清楚。如何使用jQuery檢查ajax調用是否存在?
例如,這是我的代碼的結構:
if (foo == something) {
// Ajax call 1, let it be $.ajax("foo1.html") and so on
} else {
// Ajax call 2, let it be $.ajax("foo2.html") and so on
}
我將如何測試是否$.ajax("foo1.html")
實際上已運行?
請不要再告訴我測試是否foo == something
。我的實際代碼非常複雜得多,所以請回答ajax調用的問題。
這可能嗎?
是的,正是我真正想要的。 – think123
正在檢查'state()'就像檢查'resp'的狀態是否是** 200 **? – vsync
猜猜我們永遠不會知道答案... – Denny