Hi all
I have recently taken up a large DOM scripting project, and I'm almost done , but I ran into a problem when trying to dynamically add a dblclick event to a node.
It works flawlessly in IE6, FF, Opera, and NN8
but nothing doing in Safari(Why is it Always Safari!). I enabled the hidden debug menu for Safari, and yet I don't get any error messages in the javascript console either
heres the function I use to add the event
(I modified some code I found on quirksmode so it would take some arguments)
anyone else run into this, or can point me in the right direction?Code:function addEvent(obj,evt,func,args){ f_ref = (args)?function(event){ func(event,args);}:function(event){ func(event);}; if(obj.addEventListener){ evt=evt.toLowerCase(); if(evt.indexOf("on") == 0)evt=evt.substring(2,evt.length); obj.addEventListener(evt, f_ref,false); }else if(obj.attachEvent){ return obj.attachEvent(evt,f_ref); }else{ alert('addEvent: \n No Way!\n'+ arguments.caller +'\n'+ evt); return false; } }
Thanks



Why is it Always Safari!). I enabled the hidden debug menu for Safari, and yet I don't get any error messages in the javascript console either
Reply With Quote



Bookmarks