Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  187] [ 2]  / answers: 1 / hits: 54110  / 12 Years ago, fri, september 28, 2012, 12:00:00

I need to fire a script as soon as the page content (the whole HTML element) has been received, but it doesn't have to be rendered yet.



I assume that just having a simple <script> tag that executes some code at the very top of my page should do the trick?



To formulate the question differently: does DOM ready mean that all elements and resources have been pulled and rendered?


More From » domready

 Answers
12

DOM ready means that all the HTML has been received and parsed by the browser into the DOM tree which can now be manipulated.


It occurs before the page has been fully rendered (as external resources may have not yet fully downloaded - including images, CSS, JavaScript and any other linked resources).


The actual event is called window.DOMContentLoaded.


[#82858] Thursday, September 27, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bobbidayanam

Total Points: 82
Total Questions: 99
Total Answers: 96

Location: Venezuela
Member since Sat, Apr 24, 2021
3 Years ago
bobbidayanam questions
Sat, Mar 21, 20, 00:00, 4 Years ago
Mon, Dec 24, 18, 00:00, 6 Years ago
Fri, Nov 16, 18, 00:00, 6 Years ago
;