File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes IE's Ugly red X Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "IE Watch "IE New topic
Author

IE's Ugly red X

Bob Backlund
Ranch Hand

Joined: Jun 05, 2003
Posts: 51
Hi guys,

Just a quicky. Anyone know of a way to replace the ugly Internet Exploere "image not found" red X with something a little nicer?

Basically I have a page which will list a number of images but some of them may no longer exist, so I want the page to display a default 'image unavailable' pic instead of the ugly red X

Cheers


Cheers!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Hardly a JSP question. Moved to the HTML forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

There is no standard mechanism to do this, and I doubt that IE provides a proprietary facility to do so, but you'd have to check the MSDN site to be sure.

Since you originally posted this to the JSP forum I assume you are wanting this for a JSP-generated page. What you might consider is writing your own custom image tag that would check for existance of the file and substitute a non-ugly replacement image of your own.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
<img src="asdf" onerror="this.src='error.jpg'"

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Wow, cool trick Eric!

Completely non-standard, but works in Firefox, Safari and Opera (and I imagine IE).

I'd approach any non-W3C feature with caution, but this one does seem to have broad browser support.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IE's Ugly red X
 
Similar Threads
drawing using real world coordinates
How'll I know if the Url for the image correct
Load image fromt disk to servlet
Error loading applets in Windows XP Professional 2002 SP 2
Image loading problem