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