摘要:
var elem = document.getElementById("test"); elem.addEventListener("click",aa,false); //click 代表的是事件, aa代表事件触发执行的函数 function aa(){ alert("aa"); } 阅读全文
摘要:
var button = { clicked:false, click: function(){ this.clicked = true; assert(button.clicked,"the button has been clicked"); } }; button["click"](); //... 阅读全文
摘要:
function bind(context,name){ return function(){ return context[name].apply(context,arguments); } } 阅读全文