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