Just one other thing, but is it guaranteed that 'load' fires after
'domready'? Looking at the source, there is a bit of a hack for
browsers without native domready (via DOMContentLoaded) support.
Essentially there is a check every 50ms to check if the DOM is ready.
Within that 50ms could it be possible that the page will fire the
'load' event?
I'm not sure though.
Michal.
On Oct 27, 5:31 pm, Tom Occhino <[EMAIL PROTECTED]> wrote:
> suggestion
>
> var engineManager;
>
> as a convention, you should use lowercase variable names for
> instances, and uppercase names only for Constructors (things that
> you'll use the 'new' keyword for). Assuming Engine is a Class, I wont
> go into details about how ugly things can get if you forget the new
> and do something like...
>
> var engineManager = Engine(); // <-- bad, bad, bad
>
> ...on accident. ;)
>
> On Oct 27, 2008, at 1:04 PM, Oskar Krawczyk wrote:
>
>
>
> > DOH. Man, I feel stupid. God damn time shifts – I should be home
> > already, chilling.
>
> > Thanks CroNiX!
>
> > On Oct 27, 5:01 pm, CroNiX <[EMAIL PROTECTED]> wrote:
> >> Try:
> >> var EngineManager;
>
> >> window.addEvent('domready', function() {
> >> EngineManager = new Engine();
>
> >> });
>
> >> You have to define it outside of domready. You can instantiate it
> >> within domready.
>
> >> On Oct 27, 9:54 am, Oskar Krawczyk <[EMAIL PROTECTED]> wrote:
>
> >>> Hi folks,
>
> >>> I have a weird one. Basically I'm initializing a class inside
> >>> DomReady:
>
> >>> window.addEvent('domready', function() {
> >>> var EngineManager = new Engine();
>
> >>> });
>
> >>> Right? Cool.
>
> >>> Afterwards I'd like to refer to a method by calling
> >>> EngineManager.slides() but after the whole page gets loaded so I do
> >>> this:
>
> >>> window.addEvent('load', function() {
> >>> EngineManager.slides();
>
> >>> });
>
> >>> Right? Nope... That throws an error saying that "EngineManager is
> >>> not
> >>> defined" which is odd since it's right there... defined ages ago.
>
> >>> Am I missing something or onDomReady and onLoad are two parallel
> >>> realities for themselves?
>
> >>> Best,
> >>> Oskar