What I have done finally is to use this code:

        //if the dom has loaded, execute the initClient:
        if ((Prototype.Browser.WebKit && /loaded|
complete/.test(document.readyState)) ||
            ($("__onDOMContentLoaded") && $
("__onDOMContentLoaded").readyState == "complete")) {
            this.initClient();
        }
        //otherwise, observe the dom:loaded event to execute the
initClient
        else {
            document.observe("dom:loaded", function(event) {
                this.initClient();
            }.bind(this));
        }

Maybe there is another way more elegant to know if the dom has loaded.
If anybody knows, please let us know.

Regards
Antonio

On Nov 14, 12:37 pm, "Gareth Evans" <[EMAIL PROTECTED]> wrote:
> >or to make functions attached to dom:loaded get
> >automatically run if dom:loaded has already fired?
>
> I asked this but a few hours ago!
>
> On Nov 15, 2007 7:25 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
>
>
>
>
>
> > I think that my problem is related to this problem (found in another
> > forum) :
>
> > The dom:loaded event under IE7 appears to fire much earlier than it
> > does under FF - this means that some of my observers dont get attached
> > before the event fires under IE7 - and therefore the functions being
> > attached dont get run under IE7 (everything works fine in FF).  Is
> > there any way to tell if dom:loaded has already fired when setting up
> > the observers? or to make functions attached to dom:loaded get
> > automatically run if dom:loaded has already fired?- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to