asyncが有効な場合

DOMContentLoaded

load

即時実行

jquery


document.addEventListener('DOMContentLoaded', function() {
  document.getElementById('domcontentloaded').textContent = '発火!🔥';
});
window.addEventListener('load', function() {
  document.getElementById('load').textContent = '発火!🔥';
});
(function (){
  document.getElementById('iife').textContent = '発火!🔥';
}());
$(function(){
  $('#jquery').text('発火!🔥');
});