Use the "good old" "load" event.
$(window).load(function () {
// run code
});
( from http://docs.jquery.com/Events/load )
Karl Rudd
On Fri, Mar 7, 2008 at 11:10 PM, Iair Salem <[EMAIL PROTECTED]> wrote:
>
> Sorry about not being so clear: what I exactly want is to know if
> window has loaded. I need to be sure if all the IMAGES had been
> loaded, that's why jQuery.isReady is useless for me. jquery.isReady
> equals true when DOM is loaded, but not the images.
> I hope someone could help me.
> Iair Salem.
>
> PD: Please Google do something about the delay for a message to be
> seen and searchable on the group.
>
>
> On 7 mar, 09:11, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> > As far as I know, document.ready will execute functions right away if
> > the dom is ready.
> > Also you can use: if( jQuery.isReady ).....
> >
> > On 6 mar, 17:46,IairSalem<[EMAIL PROTECTED]> wrote:
> >
> > > Hello everyone, I have a problem
> >
> > > The basics:
> > > $(document).ready(function(){alert("DOM Loaded")});
> > > $(window).load(function(){alert("Full Page & Images Loaded")});
> >
> > > But, what happens if I do this?:
> >
> > > $(window).load(function(){
> > > setTimeout("foo()", 2000);
> > > );
> >
> > > function foo(){
> > > $(window).load(function(){alert("this alert will never occur")}); /
> > > *calling window load() after it has been called once results in
> > > nothing happening....*/
> >
> > > }
> >
> > > This beaviour isn't the same as $(document).ready, because $
> > > (document).ready is handled by jQuery, and jQuery sets jQuery.isReady
> > > = true, and calls it inmediately.
> >
> > > Maybe I'm asking for the property jQuery.isPageLoaded which would tell
> > > me if the entire page has loaded, also AFTER the page has loaded (for
> > > example in a click event).
> >
> > > There is a dirty workaround:
> >
> > > var isPageLoaded = false;
> > > $(window).load(
> > > function(){
> > > isPageLoaded=true;}
> >
> > > );
> >
> > > This will workaround the problem and fix it partially (because in
> > > theory this won't work when loading scripts dinamically)
> >
> > > If you have a better solution, please share it with the group.
> >
> > > Thank you,
> >
> > >IairSalem
>