Well, to be honest, I've been focusing on Firefox and Opera mainly when developing software and never even thought that order is not guaranteed, before the task to support IE arrived! So there is plenty of code to refactor, which is very frustrating. I know that relying on event order isn't a best practice, but such a convinent one. jQuery guys would understand me, because their events are always executing in defined order.
2010/4/15 Tom Gregory <t...@byu.net> > I'm going to agree with others, and say a) this is not a bug, and b) isn't > worth making the change. The observer pattern (on which the event > architecture is based), by design, does not guarantee order; nor should it, > as it would imply the observers are not orthogonal. > > If you have order dependencies, can I suggest reworking your code? One > workaround Javascript provides is the ability to pass, assign, and wrap > functions. e.x.: > > var A = function() {alert('A');} > var A2 = A; > A = function() {alert('New A'); A2();} > A(); // Alerts "New A", then alerts "A" > > See also, Function#wrap in Prototype. [ > http://api.prototypejs.org/language/function/prototype/wrap/ ] > > If you choose that route, further questions on that feature should be sent > to the users' group. > > > TAG > > On Apr 15, 2010, at 11:51 AM, T.J. Crowder wrote: > > > Hi, > > > >> Why isn't this issue still > >> fixed?! > > > > You say "still." Is there an _open_ bug report for it in > > Lighthouse[1]? Because if there isn't, it's not going to be "fixed." > > > > In any case, I don't think it would be a fix, it would be an > > enhancement. As far as I know, Prototype does not make any guarantee > > as to the order in which multiple event handlers on an element will be > > called (because there is no guarantee provided by the underlying > > APIs). To do so, Prototype would have to replace the browser's list of > > event observers with its own, which would be overkill (IMHO). > > > > [1] http://prototype.lighthouseapp.com/projects/8886-prototype/overview > > -- > > T.J. Crowder > > Independent Software Consultant > > tj / crowder software / com > > www.crowdersoftware.com > > > > > > On Apr 15, 2:03 pm, Dziamid <dzia...@gmail.com> wrote: > >> Event.observe(window, 'load', function () { > >> alert('1');}); > >> > >> Event.observe(window, 'load', function () { > >> alert('2');}); > >> > >> Firefox, opera alerts "1" then "2", IE alerts "2" THEN "1"!! Order is > >> reversed and developeres are puzzled! Why isn't this issue still > >> fixed?! > > > > -- > > 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 > > > > To unsubscribe, reply using "remove me" as the subject. > > -- > 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 > -- 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