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

Uncategorized | Comments | Trackback

Leave a Reply

  1.  
  2.  
  3.  
  4. XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can keep track of new comments to this post with the comments feed.

Search

About Me

Web Developer with amazingness knowledge of ExtJS, jQuery, PHP, ASP, SQL. Keen follower of F1 & Football and all things tech.

Now Playing

Separate Beds - Bonus by New Found Glory
from the album Radiosurgery.
4 days ago via last.fm.

Recent Posts

Recent Comments

Categories

So Meta