loadCms_e57251cbf2e54f05af191df0f02c1949(); function loadCms_e57251cbf2e54f05af191df0f02c1949() { let xhr_param_e57251cbf2e54f05af191df0f02c1949 = "mode=view_cms_ajax&cms=text&vk=e57251cbf2e54f05af191df0f02c1949&tk=603ecf2c353b4b32b066dfae724b4233"; let url_param_e57251cbf2e54f05af191df0f02c1949 = new URLSearchParams(window.location.search); let slug_e57251cbf2e54f05af191df0f02c1949 = url_param_e57251cbf2e54f05af191df0f02c1949.get("slug"); if (null !== slug_e57251cbf2e54f05af191df0f02c1949 && "" !== slug_e57251cbf2e54f05af191df0f02c1949) { xhr_param_e57251cbf2e54f05af191df0f02c1949 += "&slug="+slug_e57251cbf2e54f05af191df0f02c1949; } let tk_e57251cbf2e54f05af191df0f02c1949 = url_param_e57251cbf2e54f05af191df0f02c1949.get("tk"); if (null !== tk_e57251cbf2e54f05af191df0f02c1949 && "" !== tk_e57251cbf2e54f05af191df0f02c1949) { xhr_param_e57251cbf2e54f05af191df0f02c1949 += "&tk="+tk_e57251cbf2e54f05af191df0f02c1949; } let xhr_e57251cbf2e54f05af191df0f02c1949 = new XMLHttpRequest(); xhr_e57251cbf2e54f05af191df0f02c1949.open("POST", "https://cms.a-pollo.jp/user/output/"); xhr_e57251cbf2e54f05af191df0f02c1949.setRequestHeader("content-type", "application/x-www-form-urlencoded;charset=UTF-8"); xhr_e57251cbf2e54f05af191df0f02c1949.send(xhr_param_e57251cbf2e54f05af191df0f02c1949); xhr_e57251cbf2e54f05af191df0f02c1949.onreadystatechange = function() { if(xhr_e57251cbf2e54f05af191df0f02c1949.readyState === 4) { if(xhr_e57251cbf2e54f05af191df0f02c1949.status === 200) { if (!xhr_e57251cbf2e54f05af191df0f02c1949.responseText) { alert("誤ったURLが設定されている可能性があります。ご確認ください。"); return; } let data = JSON.parse(xhr_e57251cbf2e54f05af191df0f02c1949.responseText); let elm = document.getElementById('cms-text-e57251cbf2e54f05af191df0f02c1949-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_e57251cbf2e54f05af191df0f02c1949.readyState); } } } }