JSFiddle - React, Tailwind, and code Playground

JavaScript

$(window).load(function() {
   var script = $('<script>console.log("hi");</' + 'script>').appendTo(document.head);
    console.log("Script was appended to", script[0].parentNode.nodeName);
});

$(document).load(function() {
   console.log("You should never see this");
});

document.onload = function () {
    console.log("You should not see this in modern browsers");
};