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