Hi,
I'd like to know if some of you have already done this?
I generate an image with a PHP script.
But the final size of the image is around 40 kb, and so when it is displayed, it doesn't appear instantly...
Therefore I would be glad if I could preload this image so it appears in one chunk.
I tried Javascript preloaders as this:
<script language="javascript">
<!--
function preloadimage()
{
image1 = new Image();
image1.src = "image.php?state=angry";
}
//--></script>
And then:
<img src="image.php?state=angry" alt="image">
But this does not work, maybe because it always asks the script for the image?
So I thought of a few ways of doing this:
Using Smarty's caching capabilities.
I don't think the will work because the image will be cached server-side, and the 40 kb will still have to travel across the net: the image will appear in a stuttering way.Generating an image on the server's disk, with a unique filename, and preloading this image instead of the PHP script...
This could work I don't know.
[/list=1]Any other ideas?