[thelist] Javascript : cancel bubble with Safari

Christian Heilmann codepo8 at gmail.com
Wed Feb 15 17:02:37 CST 2006


What is this behaviour thing you talk about?

I cannot quite follow what you are trying to do... cancelClick
actually makes sure the link is not followed but Safari does neither
get cancelBubble nor stopPropagation properly.

If all you want to do is to make the whole TR clickable and not the
link then you could just add a do-nothing handler with DOM-1...

var m=document.getElementById('matrix');
var links=m.getElementsByTagName('a');
for(var i=0;i<links.length;i++){
  links[i].onclick=function(){return false;}
}

That should do in any browser that knows the DOM.



More information about the thelist mailing list