jQuery $.extend $.fn.extend

时间:2014-05-23 12:19:34   收藏:0   阅读:374
bubuko.com,布布扣
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
(function() {
    $.extend({
        add:function() {alert(1)},
    });
    $.fn.extend({
        add:function(){alert(2)},
    })
})(jQuery)
$.add();
$("div").add();
</script>
</head>

<body>
<div></div>
</body>
</html>
bubuko.com,布布扣

 

jQuery $.extend $.fn.extend,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!