[jQuery] Re: document.ready - how to make sure all js is loaded?

2009-07-13 Thread Veeru

Thanks guys
that was a lot of valuable information. Answers my question, i will
check if it works and post it back here.

Thanks a bunch again for your effort and time

Vru


[jQuery] Re: document.ready - how to make sure all js is loaded?

2009-07-13 Thread Ricardo

It's probable that your chat script is adding #cometchatbase to the
DOM in the "onload" event handler, if it's not happening at script
evaluation time. Check it's source to confirm. If that's the case, you
should be able to use

$(window).load(function(){
 $('#cometchatbase').
});

instead of $(document).ready(function(){...

cheers
-- ricardo

On Jul 13, 4:12 am, Veeru  wrote:
> I have an example for the scenario
> I am using cometchat in my application.
> Its a third party script, that provides a chat interface to the
> website. It adds some containers to the body of the document. One such
> container is cometchatbase.
>
> I want attach something to this container on document.ready. But by
> the time document.ready is fired, the container is not generated, so $j
> ("#cometchatbase") returns null. Does this mean, before the
> cometchat.js has finished executing document.ready has already fired?
>
> Thanks
> Vru


[jQuery] Re: document.ready - how to make sure all js is loaded?

2009-07-13 Thread Michael Geary

Ah, finally you ask the *real* question.

Let's start with that next time, OK? ;-)

Don't feel bad, it's a good thing to provide a simplified test case - but in
this case the simplified example obscured the essential problem. The problem
isn't the order of execution of 

[jQuery] Re: document.ready - how to make sure all js is loaded?

2009-07-13 Thread Michael Geary

It wouldn't matter if document.ready did fire before all  tags are
loaded, because it wouldn't affect the case you were talking about: