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