Samuel, yup... that is pretty much what was happening. It had nothing
to do with Prototype. Check out the code below:

START CODE /////////

 1  var MyLibrary = {};
 2  Object.extend( MyLibrary, {
 3          Element : {
 4                  fireEvent:function( element, event ) {
 5                          if( document.createEvent ) {
 6                                  var evt = document.createEvent
("HTMLEvents");
 7                                  evt.initEvent(event, true,
true ); // event type,bubbling,cancelable
 8                                  return !element.dispatchEvent
(evt);
 9                          } else {
10                                  var evt =
document.createEventObject();
11                                  return element.fireEvent
('on'+event,evt)
12                          }
13                  }
14          }
15  });
16
17  // Usage
18  $('myhiddenfield').fireEvent("change");

END CODE /////////

The problem was line #11. I don't quite know how to fix it without
loosing the functionality but at least I know it's not a prototype
problem.


On Jul 21, 9:41 am, Samuel Lebeau <samuel.leb...@gmail.com> wrote:
> Firing an event inside a handler can cause stack overflow if the  
> handler is observing events from the same type.
>
> Even in more complex cases like (pseudocode) :
>    observe("a", fireBEvent)
>    observe("b", fireAEvent)
>    fireAEvent(); // -> stack overflow
>
> Envoyé depuis mon téléphone / Sent from my phone
>
> On 20 juil. 2009, at 20:25, Luisgo <lgo...@gmail.com> wrote:
>
>
>
> > Has anyone experienced Stack Overflow errors in IE (all versions) when
> > using Element.fire?
>
> > I've managed to narrow down the error to a call to fire but still
> > haven't managed to get pass that point.
>
> > Thanks.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to