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