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