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