Skip to content

Commit 79dbb0a

Browse files
refactor: save element to var
1 parent 14b6358 commit 79dbb0a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

assets/js/script.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
// Preloader js
55
$(window).on('load', function () {
66
$('.preloader').fadeOut(100);
7-
if(document.getElementById('calendar-container')){
7+
var calendarContainer = document.getElementById('calendar-container');
8+
if(calendarContainer){
89
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
910
const html = `<iframe src="https://calendar.google.com/calendar/embed?src=c_62694f414055ac569e5cb12dafbb0890ca22f3640b177a4b10b53171fbc9bdd4%40group.calendar.google.com&ctz=${timezone}" style=" border:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>`
10-
document.getElementById('calendar-container').innerHTML = html;
11+
calendarContainer.innerHTML = html;
1112
}
1213
});
1314

0 commit comments

Comments
 (0)