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