Prototype shortcut for Observe
This is some shortcut of Prototype JS on observing events
$$('#related_pics img').invoke('observe', 'click', function(){
alert(this.src);
});
$$('#related_pics img').each(function(element){
Event.observe(element, 'click', function(){
alert(this.src);
});
});
Categories: Web Development
Tags: javascript, prototypejs
No Comments