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