HOW TO control the timing of window.onload event

The Javascript window.onload event fires AFTER all page content including any page elements like bulky images, have loaded. As the DOM is not fully loaded until then, any script written to achieve some UI effect on the page elements on page load may not have the desired impact.

To correct this aberration, there are 2 good solutions.

The solution by Peter-Paul Koch uses inline Javascript & CSS and the other by Dean Edwards uses conditional compilation (available through HTML & JScript in IE) and the defer attribute (a HTML 4.0 property available in IE) of the SCRIPT tag.

Comments

Popular posts from this blog

Maven Crash Course - Learn Power Query, Power Pivot & DAX in 15 Minutes

"Data Prep & Exploratory Data Analysis" course by Maven Analytics

Oracle Cloud Infrastructure 2024 Generative AI Professional Course & Certification Exam (1Z0-1127-24)