Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does a load event of a browser occur?

Wondering when does a load event occur in a browser? Is it when it receives the header information?

like image 927
Prady Avatar asked Mar 03 '10 07:03

Prady


People also ask

Is website loading an event?

As a web page loads, it emits two events. These are: load , firing when all initial resources are ready: including scripts, images and CSS. DOMContentLoaded , firing when the HTML payload arrives and all non-async scripts have run.

Which element does the event fire on when an HTML page is loaded?

The onload attribute fires when an object has been loaded. onload is most often used within the <body> element to execute a script once a web page has completely loaded all content (including images, script files, CSS files, etc.).

What is difference between load and DOMContentLoaded event?

The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. A different event, load , should be used only to detect a fully-loaded page.

What is load image event?

The load event is fired when the document has been fully processed. When images are loaded eagerly (which is the default), every image in the document must be fetched before the load event can fire.


2 Answers

onload is triggered after the entire document, images and all, are loaded.

Some browsers, like Firefox, also have on-content-load events that are triggered after the HTML file is delivered, but before external files like images are loaded.

like image 51
Matthew Avatar answered Oct 18 '22 07:10

Matthew


onload occurs when all the data has been downloaded, including all css, javascript and image files.

like image 36
Marius Avatar answered Oct 18 '22 06:10

Marius