when you "var" something it makes the variable only available to that function it is set in so no i wouldnt do that
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Michal Sent: Thursday, 18 December 2008 1:22 AM To: MooTools Users Subject: Re: IE(6) and variables in domready Perhaps I've got the var thing a bit confused, but I would put var mainMenu; in the global scope, and then all later references to mainMenu should refer to that. Michal. On Dec 17, 2:12 pm, "Steve Onnis" <[email protected]> wrote: > silly question.... > > which file is being included first? > > -----Original Message----- > From: [email protected] > > [mailto:[email protected]] On Behalf Of stratboy > Sent: Thursday, 18 December 2008 1:11 AM > To: MooTools Users > Subject: IE(6) and variables in domready > > Hi! I've got a little problem with domready in ie6: > > window.addEvent('domready', function() { > //no var key, so mainMenu should be global > mainMenu = new Menu({ menuId:'menu', type:'bar', > props:mainMenu }); > }); > > later, in another .js, file > > window.addEvent('domready', function() { > mainMenu.setStartButton({ mainIndex:6, subIndex:6, > openSub:true }); > }); > > Safari and Firefox are just happy, but IE6 (don't know IE7) says that > mainMenu is not defined. > > This seems to be a mootools 1.2.1 issue, since in another site using > 1.2.0, the same classes with the same methods work fine in IE6. > > Any idea? Is that maybe the two domready don't execute in sequence? > > If can be of help, I can post links to pages. > > Bye!
