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