loadCms_efbd226e9ab54d31a4c1f625ce135bce(); function loadCms_efbd226e9ab54d31a4c1f625ce135bce() { let xhr_param_efbd226e9ab54d31a4c1f625ce135bce = "mode=view_cms_ajax&cms=gallery&vk=efbd226e9ab54d31a4c1f625ce135bce&gagtrk=0390eacd0e214e3db54d0045bbe41b23"; let url_param_efbd226e9ab54d31a4c1f625ce135bce = new URLSearchParams(window.location.search); let gck_efbd226e9ab54d31a4c1f625ce135bce = url_param_efbd226e9ab54d31a4c1f625ce135bce.get("gck"); if (null !== gck_efbd226e9ab54d31a4c1f625ce135bce && "" !== gck_efbd226e9ab54d31a4c1f625ce135bce) { xhr_param_efbd226e9ab54d31a4c1f625ce135bce += "&gck="+gck_efbd226e9ab54d31a4c1f625ce135bce; } let gp_efbd226e9ab54d31a4c1f625ce135bce = url_param_efbd226e9ab54d31a4c1f625ce135bce.get("gp[efbd226e9ab54d31a4c1f625ce135bce]"); if (null !== gp_efbd226e9ab54d31a4c1f625ce135bce && "" !== gp_efbd226e9ab54d31a4c1f625ce135bce) { xhr_param_efbd226e9ab54d31a4c1f625ce135bce += "&gp="+gp_efbd226e9ab54d31a4c1f625ce135bce; } let xhr_efbd226e9ab54d31a4c1f625ce135bce = new XMLHttpRequest(); xhr_efbd226e9ab54d31a4c1f625ce135bce.open("POST", "https://cms.a-pollo.jp/user/output/"); xhr_efbd226e9ab54d31a4c1f625ce135bce.setRequestHeader("content-type", "application/x-www-form-urlencoded;charset=UTF-8"); xhr_efbd226e9ab54d31a4c1f625ce135bce.send(xhr_param_efbd226e9ab54d31a4c1f625ce135bce); xhr_efbd226e9ab54d31a4c1f625ce135bce.onreadystatechange = function() { if(xhr_efbd226e9ab54d31a4c1f625ce135bce.readyState === 4) { if(xhr_efbd226e9ab54d31a4c1f625ce135bce.status === 200) { if (!xhr_efbd226e9ab54d31a4c1f625ce135bce.responseText) { alert("誤ったURLが設定されている可能性があります。ご確認ください。"); return; } let data = JSON.parse(xhr_efbd226e9ab54d31a4c1f625ce135bce.responseText); let elm = document.getElementById('cms-gallery-efbd226e9ab54d31a4c1f625ce135bce-area'); elm.innerHTML = data.html; Array.from(elm.querySelectorAll("script")).forEach(oldScript => { const newScript = document.createElement("script"); Array.from(oldScript.attributes) .forEach( attr => newScript.setAttribute(attr.name, attr.value) ); newScript.appendChild(document.createTextNode(oldScript.innerHTML)); oldScript.parentNode.replaceChild(newScript, oldScript); }); } else { console.log("status:"+xhr_efbd226e9ab54d31a4c1f625ce135bce.readyState); } } } } function onCmsGalleryPageChange_efbd226e9ab54d31a4c1f625ce135bce(page) { const url = new URL(window.location.href); url.searchParams.set('gp[efbd226e9ab54d31a4c1f625ce135bce]', page); window.history.pushState(null, '', url.toString()); loadCms_efbd226e9ab54d31a4c1f625ce135bce(); }