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