| 楼 [评分] | 评论人 | 评论共 4 条 | 发表时间 |
| 4 楼 [1] | 暂停打印 | 修改了一下. <input type="text" onclick="alert(this.value);" id="txt" value="abc" /> <script> function fun1(){ alert(this.type); } function fun2(){ alert("AFOS"); } function toUniteFunctions(){ var args=arguments; return function(){ for(var i=0;i<args.length;i++){ if(typeof args[i]=="function") args[i].call(this); } } } var txt=document.getElementById("txt"); txt.onclick=toUniteFunctions(txt.onclick,fun1,fun2); </script> | 2006-05-23 13:30:18 |
| 3 楼 [3] | 暂停打印 | 不知我这个方法效率如何?function fun1(){ alert("fun1"); } function fun2(){ alert("fun2"); } function toUniteFunctions(){ var args=arguments; return function(){ for(var i=0;i<args.length;i++){ if(typeof args[i]=="function") args[i](); } } } var fun3=toUniteFunctions(fun1,fun2); fun3(); | 2006-05-23 12:27:08 |
| 2 楼 [1] | 路过 | 弄复杂了吧? onload=func,多简单 | 2006-04-21 23:20:28 |
| 1 楼 [3] | 暖阳 | 欢迎对"完美解决一个事件激活多个函数"提出宝贵意见! | 2006-04-18 16:29:01 |