Hi, i have working with an aplication ... this:
and like you can see, by clicking in a line at the right, each one displays a different image. When the image is loaded, there's a javascript code for re-measurement, for adjusting to the available screen area. The easy implementation for the resizing would be:
<img onload="initHeightImag()" ...>
but 'onload' is deprecated for img tag, and W3C Markup validator doesn't validate it.
So, i have done something like this:
objImage = new Image();
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp3=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp3=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp3.onreadystatechange=function()
{
if (xmlhttp3.readyState==4 && xmlhttp3.status==200)
{
objImage.src=""+xmlhttp3.responseText;
alert(xmlhttp3.responseText);
}
}
xmlhttp3.open("GET","ajax/getsrc.php?id="+img,true);
xmlhttp3.send();
objImage.onLoad=initHeightImag();
but unfortunately the result is the image is loaded at its original size. The objImage.src is well retrieved from AJAX, like i can test with the alert: the getsrc.php?id="+img opens a MYSQL query on the database and returns the matching path to the img id, which is set before.
Can anybody give any alternative suggestion? Any help would be really appreciated.