これは私の .click コードで、ajax を使用してデータベースに投稿し、いくつかの要素を表示および非表示にします。また、notification.php を div にロードする機能を追加しましたが、問題は、このロードされた notification.php が約 1 秒で消えることです。 、それ以上に、このボタンを 2 回クリックして notification.php を表示する必要があります。何か提案はありますか?
$("#notifBtn").click(function() {
var name = $(this).attr("name");
var dataString = 'name=' + name;
var parent2 = $(".notifalert");
$.ajax({
type: "POST",
url: "voting/addnotif.php",
data: dataString,
cache: false,
success: function (html) {
}
});
parent2.load("notification.php");
$("#newpost").show();
$(".thismenu").hide();
return false;
});