Call a function in code behind without using javascript i am calling a function on onclick, onmousemove and onkeypress event in form tag and the function is in code behind but the method is not executing when user clicking, pressing a key and moving mouse ... ...
obj.attachEvent("on"+eventName,function(){//在ie低版本中,需要在事件名前加上on//在ie中事件绑定的处理函数this指向的window,需要用call将this指向obj,以便在事件处理函数中使用thisfn.call(obj); }); }else{ obj.addEventListener(eventName,fn,false); } } 使用封装函数: addEvent(obj,"click",clicnF...