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