jquery.extend()与jquery.fn.extend()

$.extend({
		
		hello : function(){
			alert(1);
		}

	});

	$.fn.extend({

		hello : function(){
			alert(2);
		}
	})

	$.hello();
	$('#div').hello();


	$.extend({net:{}});
	console.log($.net);
	$.extend($.net,{hello : function(){alert(3)}});
	$.net.hello();

  有第一个参数 合并到第一个参数,没有第一个参数合并到jquery类上

posted @ 2011-11-20 14:47  孙海勋  阅读(120)  评论(0编辑  收藏  举报