Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IE's Ugly red X

 
Bob Backlund
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hardly a JSP question. Moved to the HTML forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<img src="asdf" onerror="this.src='error.jpg'"

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic