1(function ($) { 2 const endpoint = "https://qpsc.microcms.io/api/v1/announcement_qp/"; 3 //APIãã¼ã®åå¾ 4 const apiKey = "BwyjST90g0M053N1p4ToPxFdbQyZjuP6eaNC"; 5 //ãã¼ã¿åå¾ã®ããã®ãªãã·ã§ã³è¨å® 6 const options = { 7 headers: { 8 "X-API-KEY": apiKey, 9 }, 10 }; 11 //fetch APIã使ç¨ãã¦ãã¼ã¿åå¾ 12 fetch(endpoint, options) 13 .then((response) => { 14 //ã¬ã¹ãã³ã¹ã®ãã§ã㯠15 if (!response.ok) { 16 throw new Error("Network response was not ok"); 17 } 18 return response.json(); 19 }) 20 .then((data) => { 21 //åå¾ãããã¼ã¿ã®å¦ç 22 if (data.contents && data.contents.length > 0) { 23 i =0; 24 j =1; 25 data.contents.forEach(item => { 26 // ããã«çºç«ããããå¦çã追å 27 const targetId = `detail_title_ttl${j}`; // 確èªãããID 28 const targetElement = document.getElementById(targetId); 29 if (targetElement) { 30 // IDãåå¨ããå ´å 31 // titleã¿ã°ã®è¨è¼ 32 const detail_title_ttl = document.querySelector(`#detail_title_ttl${j}`); 33 detail_title_ttl.innerText = data.contents[i].detail_title + "ï½QUICPay"; 34 // ã¿ã¤ãã«ã®è¨è¼ 35 const detail_title = document.querySelector(`#detail_title${j}`); 36 detail_title.innerText = data.contents[i].detail_title; 37 if (data.contents[i].detail_date) { 38 // å ¬éæ¥æã®è¨è¼ 39 const dateTime = data.contents[i].detail_date; 40 function formatDate(dateString) { 41 const date = new Date(dateString); 42 const year = date.getFullYear();
43 const month = String(date.getMonth() + 1).padStart(2, '0'); 44 const day = String(date.getDate()).padStart(2, '0'); 45 return `${year}/${month}/${day}`; 46 } 47 const formattedDate = formatDate(dateTime); 48 document.getElementById(`dateDisplay${j}`).innerText = formattedDate; 49 } 50 // ãã³ãããªã¹ãã®ã¿ã¤ãã«ç®æã®è¨è¼ 51 const detail_title_topic = document.querySelector(`#detail_title_topic${j}`); 52 detail_title_topic.innerText = data.contents[i].detail_title; 53 // æ¬æç®æã®è¨è¼ 54 const detail_text = document.querySelector(`#detail_text${j}`); 55 detail_text.innerText = data.contents[i].detail_text; 56 // ãªã³ã¯ç®æã®è¨è¼ 57 if (data.contents[i].detail_link && data.contents[i].detail_link.length > 0) { 58 k=0; 59 l=1; 60 data.contents[i].detail_link.forEach(item => { 61 // ãªã³ã¯ããã¹ãç®æã®è¨è¼ 62 const detail_link = document.querySelector(`#detail_link${l}`); 63 detail_link.innerText = data.contents[i].detail_link[k].detail_link_txt; 64 // ãªã³ã¯URLç®æã®è¨è¼ 65 const detail_link_dest = document.querySelector(`#detail_link${l}`); 66 detail_link_dest.href = data.contents[i].detail_link[k].detail_link_dest; 67 // ãªã³ã¯ã®å¥winåwinå¤å® 68 if (data.contents[i].detail_link[k].detail_link_window) { 69 detail_link.classList.add('m-txtLink-external'); 70 detail_link.setAttribute('target', '_blank'); 71 } 72 else{ 73 detail_link.classList.add('m-txtLink'); 74 } 75 k++; 76 l++; 77 }) 78 } 79 } 80 i++; 81 j++; 82 }); 83 } 84 }) 85 .catch((error) => { 86 //ã¨ã©ã¼å¦ç 87 console.error("There was a problem with the fetch operation:", error); 88 }); 89})(jQuery);
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.