const renderContent = (element) => {
$("#articleTitle").html(element.title);
$("#articleDate").html(`날짜 : ${element.view_indate}:00`);
var imagelistHtml = "";
element.image.forEach((element) => {
imagelistHtml += `
`;
});
$("#articleImage").html(imagelistHtml);
$("#articleSubTitle").html(`${element.sub_title}`);
$("#articleContents").html(`${element.contents.replace(/\n/g, "
")}`);
};
const initialize = (e) => {
if (e.state === false) {
alert(e.message);
return false;
}
renderContent(e.info);
$("#articleLoadingBar").hide();
$("#articeBox").removeClass("hidden");
};
(function ($) {
if (articleUid === "") {
location.href = `/`;
}
commonFunction.aJax({
url: service_url + "/get-article-detail.php",
data: {
articleUid: articleUid,
pageCategory: pageCategory,
},
type: "POST",
done: initialize,
});
})(jQuery);