JQuery – where is my onload in my body?

23Jun09

Understanding whe JavaScript is executed is crucial in creating the web 2.0 look and feel. JQuery greatly simplifies this. I think that people that started out there JavaScript with JQuery won’t appreciate how nice the library handles this.

Traditionally JavaScript programmer would hook most of their code in an onload event in the <body> tag of the HTML document. This would insure a way to hold off executing of the script until the DOM was finished loading. Unfortuntely this also waited for all the exeternal media on the page too load also. This resulted in not so smooth page loading, as you have to download all the images before the script and start executing.

JQuery solves this by executing the JavaScript after the DOM is finished but before the media has finished downloading, resulting in a smooth gradual evolvation of the page.



No Responses Yet to “JQuery – where is my onload in my body?”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.