loadCms_377e8425fdd34847b55c07fc56b87d3f(); function loadCms_377e8425fdd34847b55c07fc56b87d3f() { let xhr_param_377e8425fdd34847b55c07fc56b87d3f = "mode=view_cms_ajax&cms=gallery&vk=377e8425fdd34847b55c07fc56b87d3f&gagtrk=318da124dc9041f393c5374188dcd9a2"; let url_param_377e8425fdd34847b55c07fc56b87d3f = new URLSearchParams(window.location.search); let gck_377e8425fdd34847b55c07fc56b87d3f = url_param_377e8425fdd34847b55c07fc56b87d3f.get("gck"); if (null !== gck_377e8425fdd34847b55c07fc56b87d3f && "" !== gck_377e8425fdd34847b55c07fc56b87d3f) { xhr_param_377e8425fdd34847b55c07fc56b87d3f += "&gck="+gck_377e8425fdd34847b55c07fc56b87d3f; } let gp_377e8425fdd34847b55c07fc56b87d3f = url_param_377e8425fdd34847b55c07fc56b87d3f.get("gp[377e8425fdd34847b55c07fc56b87d3f]"); if (null !== gp_377e8425fdd34847b55c07fc56b87d3f && "" !== gp_377e8425fdd34847b55c07fc56b87d3f) { xhr_param_377e8425fdd34847b55c07fc56b87d3f += "&gp="+gp_377e8425fdd34847b55c07fc56b87d3f; } let xhr_377e8425fdd34847b55c07fc56b87d3f = new XMLHttpRequest(); xhr_377e8425fdd34847b55c07fc56b87d3f.open("POST", "https://cms.a-pollo.jp/user/output/"); xhr_377e8425fdd34847b55c07fc56b87d3f.setRequestHeader("content-type", "application/x-www-form-urlencoded;charset=UTF-8"); xhr_377e8425fdd34847b55c07fc56b87d3f.send(xhr_param_377e8425fdd34847b55c07fc56b87d3f); xhr_377e8425fdd34847b55c07fc56b87d3f.onreadystatechange = function() { if(xhr_377e8425fdd34847b55c07fc56b87d3f.readyState === 4) { if(xhr_377e8425fdd34847b55c07fc56b87d3f.status === 200) { if (!xhr_377e8425fdd34847b55c07fc56b87d3f.responseText) { alert("誤ったURLが設定されている可能性があります。ご確認ください。"); return; } let data = JSON.parse(xhr_377e8425fdd34847b55c07fc56b87d3f.responseText); let elm = document.getElementById('cms-gallery-377e8425fdd34847b55c07fc56b87d3f-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_377e8425fdd34847b55c07fc56b87d3f.readyState); } } } } function onCmsGalleryPageChange_377e8425fdd34847b55c07fc56b87d3f(page) { const url = new URL(window.location.href); url.searchParams.set('gp[377e8425fdd34847b55c07fc56b87d3f]', page); window.history.pushState(null, '', url.toString()); loadCms_377e8425fdd34847b55c07fc56b87d3f(); }