Re: Update image immediately? How to avoid waiting until onload() finishes?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Update image immediately? How to avoid waiting until onload() finishes?

From: <alexey@shtokalo.net>
Date: Fri Feb 10 2006 - 08:37:46 CET

I think you can try to use setTimeout() function with small timeout
value to start image loading...

    setTimeout('mycell.innerHTML="<img src="' + image + '">"', 200);

or split the onload action into fast and slow parts...

    function do_stuff_on_load {

      mycell.innerHTML="<img src=" + image + ">"

      setTimeout('do_stuff_on_load_continue()', 200);

    }

    function do_stuff_on_load_continue {

         ...do a bunch of other stuff that takes a long time

    }
Received on Mon May 1 03:14:22 2006