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