cfmgrv4 init...3
This commit is contained in:
parent
b23cc59540
commit
a35532b966
@ -52,22 +52,7 @@
|
|||||||
document.getElementById('lastUpdate').textContent = now.toLocaleString('ko-KR', options);
|
document.getElementById('lastUpdate').textContent = now.toLocaleString('ko-KR', options);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 페이지 로드 시 초기 시간 설정
|
// fetchRSS 함수 정의
|
||||||
updateLastUpdateTime();
|
|
||||||
|
|
||||||
// RSS 피드를 가져올 때마다 시간 업데이트
|
|
||||||
const originalFetchRSS = fetchRSS;
|
|
||||||
fetchRSS = function () {
|
|
||||||
originalFetchRSS();
|
|
||||||
updateLastUpdateTime();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="news-container" id="newsContainer">
|
|
||||||
<!-- RSS 피드 항목들이 여기에 동적으로 추가됩니다 -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function fetchRSS() {
|
function fetchRSS() {
|
||||||
fetch('/RSSFeed/getITWorld')
|
fetch('/RSSFeed/getITWorld')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
@ -91,6 +76,7 @@
|
|||||||
`;
|
`;
|
||||||
newsContainer.appendChild(newsItem);
|
newsContainer.appendChild(newsItem);
|
||||||
});
|
});
|
||||||
|
updateLastUpdateTime(); // RSS 피드를 가져온 후 시간 업데이트
|
||||||
})
|
})
|
||||||
.catch(error => console.error('RSS 피드를 가져오는 중 오류 발생:', error));
|
.catch(error => console.error('RSS 피드를 가져오는 중 오류 발생:', error));
|
||||||
}
|
}
|
||||||
@ -116,12 +102,16 @@
|
|||||||
return `${base.protocol}//${base.hostname}${base.pathname.substring(0, base.pathname.lastIndexOf('/') + 1)}${url}`;
|
return `${base.protocol}//${base.hostname}${base.pathname.substring(0, base.pathname.lastIndexOf('/') + 1)}${url}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 페이지 로드 시 RSS 피드 가져오기
|
// 페이지 로드 시 초기 시간 설정 및 RSS 피드 가져오기
|
||||||
|
updateLastUpdateTime();
|
||||||
fetchRSS();
|
fetchRSS();
|
||||||
|
|
||||||
// 1시간마다 RSS 피드 업데이트
|
// 1시간마다 RSS 피드 업데이트
|
||||||
setInterval(fetchRSS, 3600000);
|
setInterval(fetchRSS, 3600000);
|
||||||
</script>
|
</script>
|
||||||
|
<div class="news-container" id="newsContainer">
|
||||||
|
<!-- RSS 피드 항목들이 여기에 동적으로 추가됩니다 -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user