Monday, 5 January 2009

jQuery $(document).ready()

We all know that anything inside the $(document).ready() function will execute in between loading the DOM and content. Here is a syntax alternative for those who want to save a few characters:

$(function(){
// Do something.
});

Vs

$(document).ready(function() {
// Do something.
});

No comments: