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