Not using jQuery, how do I get a JS file to run immediately after page load?

I know that BSS5 defaults with no jQuery. I’m trying to go that way but some issues that jQuery makes easy are not obvious to me. Specifically, in BSS5, how do I write code so that a function in a external or imported JS File will run immediately after the page is fully loaded?

add a js file eg. named onload.js with the following content:

document.addEventListener("DOMContentLoaded", function(event) {
  //your startup code here


1 Like

This is what I needed. Thank you.