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