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