PNG Fix not working with Unique Identifiers on image paths

Hola,

We’re having a problem with Internet Explorer not rendering .png files
properly.

We’re using a Javascript fix right now, but it’s failing when it gets to
an image that has been generated by a rails image tag

(e.g. the code: <%= image_tag myimage %> spits out:
src=“images/myimage.png?1184877097”) - and that doesn’t render properly
in IE.

Here is my question:
I’m wondering if there is a way to turn off whatever tacks on the
1184877097.

(I think that’s there to prevent image caching).

Have other people had this problem? What other solutions are out there?

Thanks,
Dustin

in IE.

Here is my question:
I’m wondering if there is a way to turn off whatever tacks on the
1184877097.

(I think that’s there to prevent image caching).

Have other people had this problem? What other solutions are out there?

We’ve been using this in an onload handler and it has worked for us.
Not
sure where it came from, but PNG are transparent and we haven’t had to
muck with the ?12345 part at all.

function correctPNG() // correctly handle PNG transparency in Win IE 5.5
or higher.
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.match(/.PNG/))
{
if ( img.src.indexOf(“google.com”) != -1 ) {
continue;
}
var imgID = (img.id) ? “id='” + img.id + "’ " : “”
var imgClass = (img.className) ? “class='” + img.className + "’ "
: “”
var imgTitle = (img.title) ? “title='” + img.title + "’ " :
“title='” + img.alt + "’ "
var imgStyle = “display:inline-block;” + img.style.cssText
if (img.align == “left”) imgStyle = “float:left;” + imgStyle
if (img.align == “right”) imgStyle = “float:right;” + imgStyle
if (img.parentElement.href) imgStyle = “cursor:hand;” + imgStyle
var strNewHTML = “<img " + imgID + imgClass + imgTitle
+ " style="” + “width:” + img.width + “px; height:” + img.height

  • “px;” + imgStyle + “;”
    + “filter:progid:DXImageTransform.Microsoft.AlphaImageLoader”
    + “(src='” + img.src + “', sizingMethod=‘image’);" />”
    img.outerHTML = strNewHTML
    }
    }
    }