I've found a lot of useful code but just can't seem to get this to work. Ok, the software shows images of real estate that a user searches for in a search results page. now, my databases image fields will always be populated since I auto-generate the photo filenames based on the MLS # of the property listing. I need to be able to check if the image exists (could be on any server so can't use server-side scripting), if it does then I need to display an image of a camera that represents that photos are available on the details page, if it is not a valid photo I don;t display anything. I've tried the code before and get 'stack overflow' errors and it is slow. I've also tried changing the src property directly in the onLoad and onError events of the <img> tag:
[here are the functions]
function isGood(id) {
//var cID=new String();
//alert('The ID is '+id);
document.getElementById(id).src=' alert('That image exists for '+id);
}
function isBad(id) {
document.getElementById(id).src=' alert('That image does not exist for '+id);
}
[here is the call (using FoxWeb)]
<img id="<<Current>>" src="<<aPhoto[Current]>>" onload="isGood(<<Current>>);" onError="isBad(<<Current>>);" height="25">
FoxWeb script is between the <<>>. The img tag is generated by a FoxPro program which iterates the counter 'Current'.
Any help is much appreciated!!
[here are the functions]
function isGood(id) {
//var cID=new String();
//alert('The ID is '+id);
document.getElementById(id).src=' alert('That image exists for '+id);
}
function isBad(id) {
document.getElementById(id).src=' alert('That image does not exist for '+id);
}
[here is the call (using FoxWeb)]
<img id="<<Current>>" src="<<aPhoto[Current]>>" onload="isGood(<<Current>>);" onError="isBad(<<Current>>);" height="25">
FoxWeb script is between the <<>>. The img tag is generated by a FoxPro program which iterates the counter 'Current'.
Any help is much appreciated!!