Launching onchange event with Prototype
Some of my current JavaScript development is done with Prototype. Launching default JavaScript events with Prototype seems to be kind of awkward - Element.fire method simply won’t work.
I came up with quite a nasty workaround:
Event.observe( window, 'load', function() {
$$( '.my_element' ).each( function(element) {
Event.observe(element, 'onchange:fake', myMethod);
element.fire( 'onchange:fake' );
} );
} );
I wish this could be done in a more elegant way. Anybody?