I have a script in php to create a graph (with jpgraph) and I use javascript to set that image in my page:
$("#page_image").attr('src', "generate_graph.php");
Sometimes my server doesn't work and I got a green image telling me the error and others I got just a crash icon image (not image found or so).
Is it possible to set a timeout and if after some seconds I got nothing, set a backup image already created?
Or, must I do it in php server side?
onerrorhtml attribute?