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