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