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