Berita Terbaru dan Terpecaya Hari ini - Detikcom


${row.title}
` }, async request () { return await fetch(this.url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ size: this.size, excludeProgramIds: this.excludeProgramIds, excludeDocs: this.excludeDocs, isVertical: true }) }) }, async getData () { const req = await this.request() const data = await req.json() let indexArticle = 0 let dataPilihan = []; this.videos.forEach((video) => { dataPilihan.push({ duration: video.duration, imageurl: video.image, videourl: `https://20.detik.com${video.slug_20detik}`, number: indexArticle, id: video.id, title: video.title, animated: video.animated, pilihan: true }) }) let allData = []; const dataRecs = data.body; allData = dataPilihan.concat(dataRecs) this.videos = allData let articlesHtml = allData.map((row, i) => { indexArticle += 1 row.number = indexArticle return this.articleTemplate(row) }).join('') articlesHtml += `
Lihat Lebih Banyak
` $('.itp__articleContainer').empty() $('.itp__articleContainer').prepend(articlesHtml) helper.lqd_img('.lqd') }, detikBigDataSdk () { if (typeof detikBigDataSdk !== 'undefined') { return Promise.resolve(detikBigDataSdk) } if (typeof detikBigDataSdk === 'undefined') { return new Promise((resolve) => { const checkInterval = 100 let waitedTime = 0 const intervalId = setInterval(() => { waitedTime += checkInterval if (typeof detikBigDataSdk !== 'undefined' || waitedTime >= 3000) { clearInterval(intervalId) resolve(detikBigDataSdk) } }, checkInterval) }) } return Promise.resolve() }, async init () { this.randomIndex = Math.floor(Math.random() * this.srcModels.length) const observer = new IntersectionObserver(function (entries) { entries.forEach(async function (entry) { if (entry.isIntersecting) { observer.disconnect() await FlashPilihan.getData() lazyImageHorizontal('.itp__boxFlashItem'); initAnimatedThumbnailInview('.itp__boxFlashItem'); } }) }, { rootMargin: "0px 0px 300px 0px" }); observer.observe(document.querySelector('.itp__articleContainer')) } } $(function () { FlashPilihan.init() })

News Feed

Indeks Berita
Indeks Berita

Polling

`; constructor() { super(); this.attachShadow({ mode: "open" }); this.shadowRoot.innerHTML = CbRekomendit.html; } async connectedCallback() { new Swiper(this.shadowRoot.querySelector(".swiper"), { loop: true, slidesPerView: 2, slidesPerGroup: 2, spaceBetween: 10, pagination: { el: this.shadowRoot.querySelector(".swiper-pagination"), clickable: true, }, navigation: { nextEl: this.shadowRoot.querySelector(".swiper-button-next"), prevEl: this.shadowRoot.querySelector(".swiper-button-prev"), }, scrollbar: { el: this.shadowRoot.querySelector(".swiper-scrollbar"), draggable: true, }, }); } } customElements.define("cb-rekomendit", CbRekomendit);
Ajang penghargaan persembahan detikcom bersama POLRI kepada sosok polisi teladan. Usulkan polisi teladan di sekitarmu!
Lihat Selengkapnya

Tag Terpopuler

Berita Terpopuler

Komentar Terbanyak

logo-pu
logo-bumn
Karya Merah Putih adalah platform informasi & akuntabilitas publik untuk seluruh BUMN Infrastruktur di bawah naungan / pembinaan Kementerian PU