I seen a code snippet somewhere look like this:
$(document).ready(function(){
(function($){ $.fn.disableSelection = function() {
return this.attr('unselectable', 'on')
.css('user-select', 'none')
.on('selectstart', false); }; })(jQuery);
})
As you know, this
$(document).ready(function(){
and this
(function($){
are identical. So why should a programmer does so? Isn't (function($){
redundant in code above?