Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get rid of red X in IE for non-existing images

I have a 3rd website (Confluence) which references images which are secured by a login.

If the current user is logged in the image is shown if not the image url would redirect to a login form.

Example

<img src="secure/myimage.gif" />

When you enter this url in the browser a redirect to the login page is done.

The problem now: IE shows a the dreaded red X icon for the image even though there should be just nothing (like in Firefox). Anyone knows how to get around this?

like image 295
hugri Avatar asked Dec 18 '22 01:12

hugri


2 Answers

Use the onError event to set a default image.

This will function in any browser.

The blank image show in FF is a quirk of FF because the received file isn't an image it should report an error.

like image 86
Paulo Santos Avatar answered Jan 22 '23 21:01

Paulo Santos


Here are some solutions:

  1. redirect the page that contains secured images to the login form
  2. the image service returns a default one if security check failed.
  3. ship a hacked IE to your client with the red X replaced by a blank one like Firefox you mentioned.
like image 23
Codism Avatar answered Jan 22 '23 21:01

Codism