loadCms_95c4d8405de5498195c39752ffb00cfe(); function loadCms_95c4d8405de5498195c39752ffb00cfe() { let xhr_param_95c4d8405de5498195c39752ffb00cfe = "mode=view_cms_ajax&cms=custom&vk=95c4d8405de5498195c39752ffb00cfe&cstacsttrk=0cac77ebfc2f4b81afa766773cf2aa9e"; let url_param_95c4d8405de5498195c39752ffb00cfe = new URLSearchParams(window.location.search); let cstck_95c4d8405de5498195c39752ffb00cfe = url_param_95c4d8405de5498195c39752ffb00cfe.get("cstck"); if (null !== cstck_95c4d8405de5498195c39752ffb00cfe && "" !== cstck_95c4d8405de5498195c39752ffb00cfe) { xhr_param_95c4d8405de5498195c39752ffb00cfe += "&cstck="+cstck_95c4d8405de5498195c39752ffb00cfe; } let cstp_95c4d8405de5498195c39752ffb00cfe = url_param_95c4d8405de5498195c39752ffb00cfe.get("cstp[95c4d8405de5498195c39752ffb00cfe]"); if (null !== cstp_95c4d8405de5498195c39752ffb00cfe && "" !== cstp_95c4d8405de5498195c39752ffb00cfe) { xhr_param_95c4d8405de5498195c39752ffb00cfe += "&cstp="+cstp_95c4d8405de5498195c39752ffb00cfe; } let xhr_95c4d8405de5498195c39752ffb00cfe = new XMLHttpRequest(); xhr_95c4d8405de5498195c39752ffb00cfe.open("POST", "https://cms.a-pollo.jp/user/output/"); xhr_95c4d8405de5498195c39752ffb00cfe.setRequestHeader("content-type", "application/x-www-form-urlencoded;charset=UTF-8"); xhr_95c4d8405de5498195c39752ffb00cfe.send(xhr_param_95c4d8405de5498195c39752ffb00cfe); xhr_95c4d8405de5498195c39752ffb00cfe.onreadystatechange = function() { if(xhr_95c4d8405de5498195c39752ffb00cfe.readyState === 4) { if(xhr_95c4d8405de5498195c39752ffb00cfe.status === 200) { if (!xhr_95c4d8405de5498195c39752ffb00cfe.responseText) { alert("誤ったURLが設定されている可能性があります。ご確認ください。"); return; } let data = JSON.parse(xhr_95c4d8405de5498195c39752ffb00cfe.responseText); let elm = document.getElementById('cms-custom-95c4d8405de5498195c39752ffb00cfe-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_95c4d8405de5498195c39752ffb00cfe.readyState); } } } } function onCmsCustomPageChange_95c4d8405de5498195c39752ffb00cfe(page) { const url = new URL(window.location.href); url.searchParams.set('cstp[95c4d8405de5498195c39752ffb00cfe]', page); window.history.pushState(null, '', url.toString()); loadCms_95c4d8405de5498195c39752ffb00cfe(); }