こんにちは、値が "no" になった後でも if ステートメントと else ステートメントが関数で機能しないのは本当に奇妙です。
(function pollmsg() {
setTimeout(function () {
var demon = $('.msgnotimore').val();
alert(demon);
var a = $('.gvpgvpxgvp').val();
$.ajax({
url: 'modules/notifications/beast.php?nid=' + demon + '&id=' + a,
success: function (html) {
if(html == "no") {
alert('no');
} else {
alert('ok');
$('.msgnotimore').val();
$('.notiloadmsg').prepend($(html).fadeIn('slow'));
}
},
dataType: "html",
complete: pollmsg
});
}, 30000);
})();
});
返される値を確認するようにhtmlに警告しました。その「いいえ」ですが、それでも他の部分は機能しています。これはどのように可能ですか?