Archive

Archive for the ‘Javascript’ Category

A Better Window.onLoad with jQuery

December 23rd, 2008 clickonchris 1 comment

I have recently come to discover the javascript library jQuery. My favorite feature is the window.onLoad replacement, which is actually faster than window.onLoad and can be used multiple times in one document.

  $(document).ready(function(){
    // Your code here...
  });

Any code in the Your code here.. block will execute as soon as the page is loaded. This is useful for referencing DOM elements which would have been “undefined” before the page was fully loaded by the browser.

Categories: Javascript, Programming Tags: