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