Running tasks on load in JavaScript May 30, 2015 JavaScript applications often need to run tasks as soon as the page HTML has loaded, without waiting for images and other media to load. The DOMContentLoaded event provides this functionality, but isn’t supported in older browsers. view source Advertisement