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