If you're going to be using jQuery then it's preferable to attach an event to the document ready event using one of the following:
$(document).ready(callback);
or
$(document).ready(function () { /* do stuff */ });
or
$(callback);
or
$(function () { /* do stuff */ });