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