an image has been loaded: Using the onload event to deal with cookies: Get certifiedby completinga course today! How do I call a JavaScript function on page load? Enable JavaScript to view data. The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window. Inside window.onload function(){}) will run as soon as all page resources are loaded. The load event also fires on images. Note: For more details about the target attribute, see or