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
> 


Reply via email to