John, here's the best thing I found. Courtesy of Ron on this list:
> > <html>
> > <head>
> > <title>Image Not Found Test</title>
> > <script language="JavaScript"><!--
> > // make DARN sure this replacementImage file IS
> > // present and accounted for, or you'll get a nasty
> > // loop with repeated calls to this function.
> > // Also, enter the exact pixel dimensions of the
> > // replacement image. IE will respect it and resize...
> > // NS4 will load the replacementImage in the same
> > // dimensions as the missing one
> > var replacementImage = new Image(128,124);
> > replacementImage.src = '/images/notFound.gif';
> > function imageLoadError(myImage){
> > myImage.src=replacementImage.src
> > return false;
> > }
> > // -->
> > </script>
> > </head>
> > <body>
> > <img src="thisfilenotavailable.jpg"
> > onError="imageLoadError(this);">
> > </body>
> > </html>
Works great. As long as you don't mind the 404's in your error log.
ALthough you can make an ignore rule in your webserver for the server
you're hitting...
> >I want to include an image file that is on a server at another location.
> >If no image exists, I want to display a message stating "No Image
> >Available". I had it working fine for local images..here's the code:
> >
> ><cfset ImageFile = "d:\webroot\images\" & #Trim(sku)# & ".gif">
> ><cfif #FileExists(#ImageFile#)#>
> ><CFSET DisplayImage = "http://server.com/images/" & #Trim(sku)# &
> >".gif">
> ><IMG SRC= "#DisplayImage#">
> ><cfelse>
> >No Image Available
> ></cfif>
> >
> >How do I do that seam test for a remote server that I'm accessing via
> >HTTP (I have permission to use their image files)? Would I do something
> >with CFHTTP and then test for a valid image response?
> >
> >Thanks!
> >
> >John
> >www.cornells.com
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists