What is the difference between these two:
$(function () {
// do stuff
});
AND
(function () {
// do stuff
})();
$(function () {
// It will invoked after document is ready
});
This function execution once documents get ready mean, the whole HTML should get loaded before its execution but in the second case, the function invoked instantly after it is created.
(function () {
// It will invoked instantly after it is created
})();