Right, but what if you want to add some fancy hover effect?
WRONG
<a href="#" onClick="Application.showEntry(1); return false;" onMouseOver="this.fade('out', .5);" onMouseOut="this.fade('in');">Show entry</a>
COOL
$$('a.show-entry').each(function(el){
el.addEvent('click', function(e){
e = Event(e).stop();
$('container').load(el.get('href'));
});
el.addEvent('mouseenter', function(){
el.fade('out', .5);
});
el.addEvent('mouseleave', function(){
el.fade('in');
});
});
We don't need to touch the HTML to accomplish this effect.