Javascript

Home Load Console Selectors CSS Form Strings If Else Array Reg Exp Date & Time setTimeout JSON Loops Objects Animation Fat Arrow Class Import IIFE undefined Tabulator.js ES6 Event Listeners AJAX Hide Elements Create Elements Checkbox ejs
O O

Weather Controls

Time Of Day
Rain
Wind Speed
Wind Direction
Clouds

Javascript : Load

2022-07-18

Add script to HTML

<script type="text/javascript" src="/js/myjs.js"></script>

ES6 DOM Loaded

document.addEventListener('DOMContentLoaded', (e) => {
    console.log(123);
});

jQuery DOM Loaded

$(document ).ready(function() {
    console.log(123);
});
$(function() {
    console.log(123);
});

Old School

<body onload="myFunction()">
window.onload = myFunction;