I added a semicolon to the end of my global wrapper var:

var MYAPP = {class1: null, class2: null};

But I still get the same order. I believe that since this is
executable code, IE doesn't care if it creates it AFTER I try to use
it.

On Sep 3, 12:56 pm, "Alex McAuley" <[email protected]>
wrote:
> Sometimes IE moans about the lack of a semi colon on the end of some Json'd
> code
>
> For example
>
> var foo ={bar:function(){alert('Hi');}}
>
> fails in some IE's (cant remember which one) but
>
> var foo ={bar:function(){alert('Hi');};
>
> Works in every browser - i had to update some code to fix similar errors on
> my web desktop
>
> Alex Mcauleyhttp://www.thevacancymarket.com
>
> ----- Original Message -----
> From: "JoJo" <[email protected]>
> To: "Prototype & script.aculo.us" <[email protected]>
> Sent: Thursday, September 03, 2009 7:40 PM
> Subject: [Proto-Scripty] Re: execution order in IE
>
> ^ great article!
>
> Now I have another question.  Here is my new workflow in an attempt to
> execute files in the correct order across all browsers.  It works in
> IE8, but not in IE7.  In IE7 I get an error saying "object expected"
> on line 2 of main.js.  This is not very descriptive; what does it
> mean?
>
> (1) include my global wrapper MYAPP.js:
>
>     MYAPP = {class1: null, class2: null}
>
> (2) include Class1.js (no instantiation)
> (3) include Class2.js (no instantiation)
> (4) include main.js:
>
>     Event.observe(window, 'load', function() {
>         MYAPP.class1  = new MYAPP.Class1();
>         MYAPP.class2  = new MYAPP.Class2();
>     });
>
> On Sep 3, 10:40 am, DJ Mangus <[email protected]> wrote:
> > See this
> > article:http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...
>
> > On Thu, Sep 3, 2009 at 9:25 AM, JoJo <[email protected]> wrote:
>
> > > Instead of loading JS in the <head>, how do I do includes like
> > > virtually all other languages? Isn't Scriptaculous loading Effects.js
> > > and other files? How is it doing that?
>
> > > On Sep 2, 11:36 pm, "Alex McAuley" <[email protected]>
> > > wrote:
> > > > If you need to garuntee that a variable,function or method exists i
> > > > would
> > > > always wait until the dom is ready or in each function that gets
> > > > called
> > > test
> > > > the function,variable or method exists else timeout untill it does
> > > > Alex Mcauleyhttp://www.thevacancymarket.com
>
> > > > ----- Original Message -----
> > > > From: "JoJo" <[email protected]>
> > > > To: "Prototype & script.aculo.us" <
> > > [email protected]>
> > > > Sent: Thursday, September 03, 2009 6:31 AM
> > > > Subject: [Proto-Scripty] execution order in IE
>
> > > > > In my <head>, I'm loading several JS files. I'm expecting this to
> > > > > occur:
>
> > > > > 1) script1.js is loaded
> > > > > 2) script1.js runs - it creates an object
> > > > > 3) script2.js is loaded
> > > > > 4) script2.js runs - it creates a different object that depends on
> > > > > script1's object.
> > > > > 5) and so on....
>
> > > > > This works perfectly in Firefox and Safari, but fails about 25% of
> > > > > the
> > > > > time in IE. I've heard that IE will load JS files in the correct
> > > > > order, but will not guarantee that they are executed in the same
> > > > > order. How can I restructure my code or use Prototype to fix my
> > > > > current code?
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to