Fixed 404 error for ie-css.htc
May 21st, 2010
I have been using the awesome .htc file to give IE6 support for border-radius.
However while checking network traffic with HTTP Watch I noticed it was making a request to mydomain.com/none, bit of a deal breaker when your replacing images for the corners with downloading your full 404 error page in the background.
I tracked the issue down to line 253
this.fillSrc = this.currentStyle.backgroundImage.replace(/^url("(.+)")$/, '$1');
As I understand it (and I suck at regex) if there is not a background-image declaration then it returns “none” therefore a simple check for it and changing the value to “” fixes it
This is what I changed it to:
this.fillSrc = ( this.currentStyle.backgroundImage.replace(/^url("(.+)")$/, '$1') == "none" ? "" : this.currentStyle.backgroundImage.replace(/^url("(.+)")$/, '$1') );
Simples
Leave a Reply