1// /* -------------------- 2// * event banner 3// * ----------------- */ 4function checkFileExistence(url) { 5 return new Promise((resolve, reject) => { 6 fetch(url) 7 .then(response => { 8 if (response.ok) { 9 resolve(response); 10 } else { 11 reject(); 12 } 13 }) 14 .catch(() => { 15 reject(); 16 }); 17 }); 18} 19 20function fetchJsonData(body, url) { 21 checkFileExistence(url) 22 .then(response => response.json()) 23 .then(function(data) { 24 const open = data.external ? "_blank" : "_self"; 25 document.getElementById('eventbanner').insertAdjacentHTML('beforeend', ` 26 <div class="m-banner"> 27 <span class="c-line-01"></span> 28 <a class="m-banner-innner" href="${data.url}" target="${open}"> 29 <div class="m-banner-img"> 30 <img src="/image/jp/feature/common/${data.imagePath}" alt=""> 31 </div> 32 <div class="m-banner-text"> 33 <span class="c-tag_application">${data.application}</span> 34 <div class="m-banner-text-title">${data.title}</div> 35 <div class="m-banner-text-date">${data.date}</div> 36 <div class="m-banner-text-desc">${data.desc}</div> 37 </div> 38 </a> 39 <span class="c-line-01"></span> 40 </div>` 41 ); 42 }) 43 .catch(() => {}); 44} 45 46function generateBanner() { 47 const body = document.querySelector('body'); 48 const dataUrl = '/json/jp/feature/eventBannerData.json'; 49 fetchJsonData(body, dataUrl); 50} 51 52generateBanner();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.