try to inject your element in the dom first,

I have not tested it but IE sometimes throw errors on some methods when the
element is not in the dom. this could happen if for example you try to get
coordinates,


On Sat, Dec 5, 2009 at 5:00 PM, Steve Onnis <[email protected]> wrote:

> Your example doesn't work
>
> The issue I am having is in IE
>
> -----Original Message-----
> From: Oskar Krawczyk [mailto:[email protected]]
> Sent: Sunday, 6 December 2009 2:58 AM
> To: [email protected]
> Subject: Re: [Moo] addEvent sequence in IE
>
> You need to define the variable.
>
> http://mooshell.net/u/oskar/V924A/8/
>
> On 5 Dec 2009, at 13:12, Steve Onnis wrote:
>
> > I am having a little trouble with something i am working on which for
> some
> > reason works in FireFox but not in IE
> >
> > Is there a squence on which the addEvent actions are run on the window
> > object?
> >
> > Take the following Class for example
> >
> > var MooFormValidator = new Class({
> >       Implements : [Events, Options],
> >       options : {},
> >       initialize : function (element, options) {},
> >       boo : function () {alert("hello");}
> >       });
> >
> >
> > // This errors in IE saying that "formValidator" is undefined
> > // http://mooshell.net/V924A/6/
> > window.addEvent("load", function () {
> >       formValidator = new MooFormValidator(new Element("div"), {});
> >       });
> > window.addEvent("load", function() {
> >       formValidator.boo()
> >       });
> >
> > // Where as the following works fine
> > http://mooshell.net/V924A/7/
> > window.addEvent("load", function () {
> >       formValidator = new MooFormValidator(new Element("div"), {});
> >       formValidator.boo()
> >       });
> >
> >
> > Anyone explain to me why this is happening? And how I can overcome it?
> >
> > Steve
> >
>
>
>


-- 
http://tbela99.blogspot.com/

fax : (+33) 08 26 51 94 51

Reply via email to