Possible Duplicate:
Different forms of $(document).ready
What is the difference between these jQuery ready functions?
What is the difference between the following two functions?:
$(function() { });
and
$(document).ready(function(){});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.ready is a handler function for use once the DOM is ready
The .ready() method is generally incompatible with the attribute.
I would use
$(function() {});normally.$(document).ready(function(){});is typically used for anonymous functionsAll three of the following syntaxes are equivalent:
http://api.jquery.com/ready/