$.fn和$.extend书写方式

$.extend({
addMe:function(a,b){
console.log(a + b);
}
});

$.fn.extend({
showTest:function(){

console.log(this);
}
});


$.extend($.fn,{
showAge:function(){
console.log(this[0].dataset.age);


}
});


$("#test").showAge();
$("#test").showTest();
$.addMe(4,9);

此上三种写法都可以

原文地址:https://www.cnblogs.com/yubolin/p/5206275.html