I am wondering why the $(function () {} is getting executed all the time. function test(0 is not. what’s the difference between those two?
I am wondering why the $(function () {} is getting executed all the time.
Share
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.
jQuery’s extreme shorthand tends to trick the eye sometimes.
Look closely at the construct: A function named
$gets called, with the function as an argument. This is not equal to defining a function for later use likefunction test() { .... }$is jQuery’s “document ready” shortcut. The function passed to it will get executed once the document is loaded.