我有问题....我在 php 中有一个监听器脚本,它可以做到这一点:
if ($count != 1) {echo 'no';} else { echo "yes";}
所以它会根据任务是否成功而回显“是”或“否”,并且在我的页面上我有这个:
jConfirm('Are you sure you want to delete this publisher?', 'Delete publisher', function (r) {
if (r) $.post('includes/publishers/delete-publisher.php?publisherid=' + publisherid,
function(data) {
if (data == 'no') {
$.jGrowl('Error - PUBLISHER WAS ALREDY DELETED !');
alert("Data Loaded: " + data);
} else {
$(element).parents('tr').remove();
$.jGrowl('Publisher deleted');
alert("Data Loaded: " + data);
}
});
});
问题是尽管 delete-publisher.php 回显“否”(我看到它在警报框中回显) - JQuery 总是处理这个好像响应是“是”!?我错过了一些明显的东西吗?