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