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