0
我以前在ajax調用的成功函數中使用if語句,但對於我的生活,我無法使其工作。我可以提醒所有VARS並顯示數據,但條件聲明不起作用。我究竟做錯了什麼?我無法得到它。如果語句在Jquery Ajax調用中不起作用?
jQuery.ajax({
type: "POST",
url: "/ajax/uiProcessPhoto.php",
data: "action="+ action,
success: function(response){
var s_response = response.split("|");
var qsize = data.fileCount;
var ptotal = s_response[0];
var ltotal = s_response[1];
var allowed = s_response[1] - s_response[0];
if (ptotal >= ltotal){
alert("Unable to add photos to queue. You have reached the maximum number of photo uploads allowed.");
}else if (ptotal + qsize >= ltotal){
alert("The total photos select will exceed the maximum upload limit. Please upload up to " + allowed + " more photos to continue.");
}else if (response == 1){
jQuery('#upload').show();
};
alert(allowed);
}
});
爲什麼要刪除您迴應BalusC?我看到它是什麼,它的工作。我打算接受它,但它給了我一個錯誤,它被刪除了。 ??? – 2010-09-05 04:13:34
我腦海中出現了一個小故障(現在已經晚了)。爲了安全起見,我刪除了答案,並試圖重現問題,只是爲了確保。我終於意識到,我是對的,所以我把答案帶回:) – BalusC 2010-09-05 04:14:48