If you want them in a particular order you should add the functions to an 
array and loop the array on dom / window load as i am positive that the 
array will output in order starting at zero...

var arr;

for(var =0;i<arr.length;++i) {

... untested and would probably need to be evaled and tweaked a bit but the 
concept remains the same.

Alex Mcauley
----- Original Message ----- 
From: "RobG" <robg...@gmail.com>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Wednesday, September 30, 2009 12:34 AM
Subject: [Proto-Scripty] Re: IE Add Observers in Reverse Order?

On Sep 29, 8:45 am, KammylandSoftware <kammyl...@gmail.com> wrote:
> When ever you add oberservers to the same event such as
> Event.oberve("myElement", "mousedown", "someMethod_1()");
> Event.oberve("myElement", "mousedown", "someMethod_2()");
> does IE execute them in REVERSE order upon fire?
> They get executed by order of chronological assignment in FF.
> IE is a bloody-idiot.

IE doesn't implement the W3C Event model and even if it did, it
wouldn't necessarily help. The DOM 2 Events specificaton specifically
says event listeners aren't guaranteed to execute in any particular

 "Although all EventListeners on the EventTarget are
  guaranteed to be triggered by any event which is received
  by that EventTarget, no specification is made as to the
  order in which they will receive the event with regards to the
  other EventListeners on the EventTarget."

<URL: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-basic

However, the DOM 3 Events spec says order must be preserved. You may
find this thread interesting:


If you want an event registration system that will ensure listeners
are called in the order they are added, you could use something like
the code suggested here:


Read the rest of the thread, it is interesting. You could also read
this one:


Don't use the code suggested by the OP, read the responses by Richard
Cornford to get valuable insights into how to implement what you are


You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to