I was researching on jQuery best practices and found this article by Greg Franko
Normally, I do:
$(\"document\").ready(function() { // The DOM i
You can use document ready event using jquery, event occure when document is fully loaded.
$(function () { setTimeout(function () { // your code }, 0); })