jQuery $.extend $.fn.extend
时间:2014-05-23 12:19:34
收藏:0
阅读:374
<!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>
评论(0)