Reputation: 174
I have tried (data = "") and various others but none seem to work.
$.ajax({
url: "includes/peopleGoingList.php",
type: "POST",
dataType: "html",
data: {"ID": eventID},
success: function(data){
console.log(data);
if (data.length === 0) {
$("#dialog-attendees").html("<p>No one is going.. :[</p>");
} else {
$("#dialog-attendees").html(data);
}
});
Upvotes: 0
Views: 75
Reputation: 97672
There are probably arbitrary white space in your output, try trimming it
if ($.trim(data) == '') {
Upvotes: 3