MSHTML reserve for uri: s data

My site uses uri: s data to reduce the number of HTTP requests on my site. The problem is that uri: s data does not work in IE7, the browser we need to support (no, we don't need IE6). I followed the Stoyan guide and actually got it to work, but after a recent security update for Microsoft (KB2544893, as described in the comment on the original article ), it seems that the backup has stopped working.

The above comment suggests trying to send the MSHTML file with the message Content-Type / rfc822, but I cannot get this to work, and I tried several different ways for several hours.

So my question is:. Can you get the method described by Stoyan to work somehow? I would really appreciate a working example to convince me that this is really possible.

+4
source share
3 answers

I contacted Stoyan Stefanov (the original author of this technique), and he corrected his original example so that it now works. Just adding "message / rfc822" as the content was all necessary.

Example fixed: http://www.phpied.com/files/datasprites/testhover2.html

I asked him to post a comment here so that I could award points, but he did not want to.

+3
source

Personally, I would use conditional styles. In your main markup - run it like this:

<!DOCTYPE html> <!--[if IE 7]> <html lang="en-us" class="ie7"> <![endif]--> <!--[if IE 8]> <html lang="en-us" class="ie8"> <![endif]--> <!--[if gt IE 8]><!--> <html lang="en-us"> <!--<![endif]--> 

In your css you can now:

 .myClass { background-image: url(/*DATAURI GOES HERE*/); } 

and

 .ie7 .myClass { background-image: url(fallback-image.png); } 

UPDATE

In addition to the comments below, if you are concerned about IE7 performance - a reliable approach is to make your IE7 a backup sprite image .

This way you only make one HTTP request for IE7 users:

 .ie7 .myClass { background-image: url(fallback-sprite.png); background-position: 150px 15px; } 
+3
source

All Articles