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