There are two events related to web page load - ondomcontentloaded
and onload
.
At which point will the user will be able to see the web page?
There are two events related to web page load - ondomcontentloaded
and onload
.
At which point will the user will be able to see the web page?
That really depends on the browser. Chrome and Firefox progressively render the webpage as it loads, even if HTML hasn't been completely sent. This will be happening before either of those events are triggered.
onload
will always fire after DOMContentLoaded
, so if you want the earliest event, use DOMContentLoaded
.