jQuery its ‘document ready’ can be written on different ways.

I have seen a lot of scripts already still using a old way of checking if the DOM is ready for action like this:

or (which is not smart cause onload waits for even the images to be loaded):

jQuery has a nicer way to implement this with the following piece of code:

However you can write this even a bit shorter than most people already do by using the above code, like this:

I hope you find this useful, make something nice with jQuery! 😉