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