jquery가 자신의 플러그인을 봉인하는 두 가지 방식
680 단어 js 노트
1、(function($){ //($) $
$.fn.extend({ //jquery
check: function() {
return this.each(function() { this.checked = true; });
},
uncheck: function() {
return this.each(function() { this.checked = false; });
}
});
})(jQuery) 2、(function($){ // $ jQuery.extend({ // min: function(a, b) { return a
b ? a : b; }, max: function(a, b) { return a > b ? a : b; } }); })(jQuery)