1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman
Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

Faster DOM Access

Friday August 29, 2008
Unobtrusive JavaScript is less obvious if you access the elements as they load.

One of the biggest disadvantages that updating a web page via the DOM has is that the element on the page that you want to update must exist before you can update it. Most scripts solve this problem by waiting until the whole page has loaded before trying to update the page via the DOM. This simple alternative just checks over and over for if the particular element exists and will perform the update as soon as the necessary part of the page has loaded rather than waiting for the entire page.

Faster DOM Access
Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.