What is the difference between these two:
$(function () { // do stuff });
AND
(function () { // do stuff })();
The first uses jQuery to bind a function to the document.ready event. The second declares and immediately executes a function.
document.ready
1.4m articles
1.4m replys
5 comments
57.0k users