dojo.connect与createSequence

Ext(YUI)扩展的Function.prototype.createSequence方法:
var obj ={
    test:function(){
		alert(1);
	}
};
obj.test = obj.test.createSequence(function(){
	alert(2);
}).createSequence(function(){
	alert(3);
});
obj.test//alert 1,2,3

////////////////////////////////////

dojo.connect(obj,"test",function(){
	alert(2);
});
dojo.connect(obj,"test",function(){
	alert(3);
});
obj.test();//alert 1,2,3

你可能感兴趣的:(JavaScript,ext,prototype,dojo,yui)