首页 > 其他 > 详细

$.fn和$.extend书写方式

时间:2016-02-22 11:35:07      阅读:166      评论:0      收藏:0      [点我收藏+]

$.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);

 

此上三种写法都可以

$.fn和$.extend书写方式

原文:http://www.cnblogs.com/yubolin/p/5206275.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!