I used if statements before in a the success function of an ajax call but for the life of me I can't get this to work. I can alert all VARS and they show the data, but the condition statement will not work. What am I doing wrong? I just can't get it.
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);
}
});