function Re(){ var Yi=document.getElementsByTagNameNS("a"); for(var i=0;i<Yi.length;i++){ ? ? ? ?popUp=function(winURL){//window對象的open()方法來創(chuàng)建新的瀏覽器窗口 window.open(winURL,"popUp","width=320,height=480"); }Yi[i]=popUp(this.href);return false; var Tc=document.getElementById("Tc");/*function Rc(){//Dom0級事件:var Fan=document.getElementsByTagName("a");for(var i=0;i<Fan.length;i++){Fan[i].onclick=function(){"Fan[i]= popUp(this.href);return false;}}} Rc();*/? var lilike={ //添加句柄 Nuse:function(Dc,type,handler){ if(Dc.addEventListener){ Dc.addEventListener(type,handler,false); ?//google等瀏覽器 Dom二級事件 }else if(Dc.attachEvent){ Dc.attachEvent('on'+type,handler);//ie瀏覽器 DOM二級事件 }else{ Dc['on'+type]=handler; //DOM 0級事件 } } } lilike.Nuse(Fan[i],'click',Re); }} 也不知道哪里出現(xiàn)了問題!求教。
js 跨瀏覽器問題DOM二級綁定onclick事件出現(xiàn)問題
亂也
2016-11-19 20:05:29