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