$(function(){ $(document).on("click", ".titbit-toggle, .titbit-switch-btn", function(){ let _this = $(this) $.ajax({ type: "POST", url: Project_Country + "about/ajax/ajax_get_titbit.php", data: _this.data(), dataType:"JSON" }).done(function(res){ let html = res.html console.log(res) if(html){ let popup = $("#titbitPopup") let prev = popup.find(".titbit-prev") let next = popup.find(".titbit-next") if(res.lid){ prev.data("id", res.lid).removeClass("hide") }else{ prev.data("id", "").addClass("hide") } if(res.rid){ next.data("id", res.rid).removeClass("hide") }else{ next.data("id", "").addClass("hide") } popup.find(".popupBox-title").text(res.title) popup.removeClass("hide").find(".web-editor").html(html) } }).fail(function(err){ alert(_jsLang.資料庫忙線中) }) }) });