Skip to content

Commit d7945fd

Browse files
committed
document.onload is not reliable, so use eventListener
1 parent ede96ab commit d7945fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fetch/programmer-humour/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ async function displayComic() {
2222
}
2323
}
2424

25-
document.onload = displayComic();
25+
document.addEventListener("DOMContentLoaded", displayComic);

0 commit comments

Comments
 (0)