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