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