Allora, usando il mio, avresti potuto in ogni caso mettere il loading nell' onload del body, così:
Codice PHP:
<html>
<head>
<script language="JavaScript">
function loadImage(imgUrl, loading_in_millisecondi){
document.getElementsByTagName('SPAN')[0].innerHTML='Caricamento...';
setTimeout("document.getElementsByTagName('SPAN')[0].innerHTML='[img]+imgUrl+[/img]';", loading_in_millisecondi);
}
</script>
</head>
<body onload="loadImage('http://utenti.html.it/common/img/logo_forum.gif', 5000);">
<span>
</span>
</body>
</html>
Se lo vuoi fare con jQuery è comunque facile:
Codice PHP:
<html>
<head>
<script src="path_per_jquery.js" language="JavaScript"></script>
<script language="JavaScript">
document.getElementsByTagName('SPAN')[1].innerHTML = 'Caricamento...';
$(document.getElementsByTagName('IMG')[0]).ready(function () {
document.getElementsByTagName('SPAN')[1].innerHTML="Fatto";
});
</script>
</head>
<body onload="">
<span>
[img]http://utenti.html.it/common/img/logo_forum.gif[/img]
</span>
<span>
</span>
</body>
</html>
Se non funziona posta, ma fai conto anche che ho copiato il codice e ottimizzato dal sito ufficiale di jQuery.