The "loaded" flag should be moved away from the "document", to avoid
extending each host object.

To allow for iframes and multi-document environments, a list of
"loaded" flags should be kept apart, one item for each document/loaded
pair.

An internal check on the "loaded" flag could easily be implemented in
Prototype, at least to fire the handler immediately if "loaded" for
that document is already set.

my 0.2 €

--
Diego

On 25 Mar, 17:36, "Thompson, John" <jth...@midwestern.edu> wrote:
> True, and it would be nice to have it fire immediately if the dom is already 
> loaded. I went ahead and coded it to check document.loaded.
>
> -----Original Message-----
> From: prototype-scriptaculous@googlegroups.com 
> [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of T.J. Crowder
> Sent: Thursday, March 25, 2010 12:21 AM
> To: Prototype & script.aculo.us
> Subject: [Proto-Scripty] Re: Test if Dom is ready
>
> @Jeffrey: For script tags in the source of the main page, it shouldn't
> be a problem no matter where you put the script tag. I'm assuming he's
> loading script after page load.
>
> -- T.J.
>
> On Mar 25, 1:28 am, Jeffrey Peck <jeff.p...@snet.net> wrote:
> > Put this in the document head and it should work every time.  I have  
> > never had a problem with dom:loaded, and it just so happens that I  
> > always put it in the <head>.  If I had to guess, that's the issue.
>
> > - Jeff
>
> > On Mar 23, 2010, at 12:40 PM, John wrote:
>
> > > I am using
>
> > > document.observe("dom:loaded", function() {
> > >   ...
> > > });
>
> > > to hook into the dom loaded event, but I'm finding that if the dom
> > > loaded event has already fired my code is not executed. So I want to
> > > test if the dom is already loaded so I know whether it immediately
> > > execute or add this observe event. Is there a way to test if the dom
> > > is already loaded?
>
> > > Thanks.
>
> > > --
> > > 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 
> > > prototype-scriptaculous@googlegroups.com
> > > .
> > > To unsubscribe from this group, send email to 
> > > prototype-scriptaculous+unsubscr...@googlegroups.com
> > > .
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/prototype-scriptaculous?hl=en
> > > .
>
> --
> 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 prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to