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