harmmeijer
Programmer
Can the <img .. > html tag detect of the scr exist or not?
If it does not exist can it automatically take an alternative image?
I made a javascript wich will preload all the images and another script which checks the widh and height of the preloaded images (I hope IE has got a fixed with and height for a 'broken' image)
Anyway here is the java code, if anyone knows a way to do this with a tag property of img please let me know.
<label id='loading' name='loading'>dsf</label>
<script language=javascript>
loading.innerText = "Loading images";
var arrImg = new Array
var arrImgID = new Array
//here the asp page will loop through all the records to generate the html
// and this javacode (strhtm and strjavaclient)
arrImg[0] = new Image
arrImg[0].src = "images/image17.jpg"
arrImgID[0] = "17"
loading.innerHTML = "";
//rs.movenext -> loop
</script>
<table>
<tr vAlign=top>
<td style='width: 4.9cm; height: 1.8cm;'></td>
<td style='width: 4.9cm; height: 1.8cm;'></td>
<td style='width: 4.9cm; height: 1.8cm;'></td>
</tr>
<tr vAlign=top>
<td style="width: 4.9cm; height: 3.64cm; cursor: hand">
<img src="images/image17.jpg" alt='images/none.jpg'id=img17 name=img17 style="width: 4.9cm; height: 3.64cm">
</td>
</tr>
<tr vAlign=top>
<td style="cursor: hand">
Harm Meijer
</td>
</tr>
</table>
<script language=javascript>
var i = 0
while(i < arrImg.length) {
if(arrImg[0].width == "28" &&arrImg[0].height == "30"
{
eval('img' + arrImgID).src = "notavaileble.jpg";
}
i++;
}
</script>
If it does not exist can it automatically take an alternative image?
I made a javascript wich will preload all the images and another script which checks the widh and height of the preloaded images (I hope IE has got a fixed with and height for a 'broken' image)
Anyway here is the java code, if anyone knows a way to do this with a tag property of img please let me know.
<label id='loading' name='loading'>dsf</label>
<script language=javascript>
loading.innerText = "Loading images";
var arrImg = new Array
var arrImgID = new Array
//here the asp page will loop through all the records to generate the html
// and this javacode (strhtm and strjavaclient)
arrImg[0] = new Image
arrImg[0].src = "images/image17.jpg"
arrImgID[0] = "17"
loading.innerHTML = "";
//rs.movenext -> loop
</script>
<table>
<tr vAlign=top>
<td style='width: 4.9cm; height: 1.8cm;'></td>
<td style='width: 4.9cm; height: 1.8cm;'></td>
<td style='width: 4.9cm; height: 1.8cm;'></td>
</tr>
<tr vAlign=top>
<td style="width: 4.9cm; height: 3.64cm; cursor: hand">
<img src="images/image17.jpg" alt='images/none.jpg'id=img17 name=img17 style="width: 4.9cm; height: 3.64cm">
</td>
</tr>
<tr vAlign=top>
<td style="cursor: hand">
Harm Meijer
</td>
</tr>
</table>
<script language=javascript>
var i = 0
while(i < arrImg.length) {
if(arrImg[0].width == "28" &&arrImg[0].height == "30"
eval('img' + arrImgID).src = "notavaileble.jpg";
}
i++;
}
</script>