|
Posted by Chung Leong on 10/13/06 21:09
Mateusz Markowski wrote:
> Chung Leong napisal(a):
> > Cleverbum@hotmail.com wrote:
> > > I realise that once the html in the page has been sent the browser
> > > still needs to load all of the images, that's why the onload won't
> > > work, and why I was looking for a trigger that fires "once the page and
> > > all the images on it have loaded"
> > >
> > > I'm reluctant to change the language of the processing script as it's
> > > taken me quite some time to write it all, at the moment I've just got a
> > > link at the bottom of the processing page saying "once the above box is
> > > completely full please click here", unless there is something which can
> > > do that automatically I think I will just forget about it and rely on
> > > someone's built in clicking skills.
> >
> > As mentioned already, each img tag would emit an onload event. The
> > event doesn't bubble up so you have to add onload=" ... " to each tag.
> > Now, if you just increment a counter as the images load and do a
> > redirect when it reaches the total, you'll have what you need. Simple,
> > no?
>
>
> function waitForImages()
> {
> while(!document.images[document.images.length-1].complete);
> document.location.href = '/loaded';
> }
>
> waitForImages();
>
> Isn't easier?
I'm pretty sure that would cause the browser to freeze.
Navigation:
[Reply to this message]
|