Monday, November 02, 2009

Prototype - exception to be handled for IE

Prototype 1.6 has introduced API that works pretty well in Firefox but experienced a problem in IE (7).

Exception was being thrown in API that needed a special treat.

The highlighted workaround worked for me:
fire: function(element, eventName, memo) {
// ...
if (document.createEvent) {
} else {
element.fireEvent(event.eventType, event);
} catch(error) {
// Error: No such interface supported (IE)
return event;
Example:'myhidden_element_id', 'custom:change');

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?