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