Infrequently Noted

Alex Russell on browsers, standards, and the process of progress.

Alike

figured out event setting on Opera, it's just like IE 5 for the mac. Instead of


node.setAttribute("eventName", "some code");

one should use

eval("node."+eventName+"=function(){"+somecode+"};");

to set event handlers on dynamically created nodes in Opera 7. For simple assignment (when you know the name of the event and it's not passed into a function or anything), this works:

node.eventName=function(){somecode();}