Search code examples
htmlinternet-explorer-6base64mhtmldata-url

Images in one file under IE6 WITHOUT php


I need to create a page with all images and CSS in it, so it would be only one file.

I know that there is something like MHT (IE web archive), BUT there is problem. It works only in IE and Opera, not in FF. And i need my page to be working in all IEs (6+), Opera and FF. I know there is a way to encode my images in base64 and I also know, that IE 6 and 7 does not support data URLs. I've seen Dean Edward's trick for IE 6 and 7 but it works only with PHP support. And I can't use PHP, so this isn't working for me.

So, is there any way to create this kind of page? Please don't give me answers like "who is using IE6 today" or "install chrome frame". I know all this, but I need it to be working this way.

Thanks for the answer!


Solution

  • There is no cross-browser way to integrate all resources into one HTML file.

    Your best bet is probably to serve a .MHT file for IE, and one with data: URIs for Firefox et al.

    In some situations, a viable compromise may be serving a ZIP file that contains all resources, referenced using relative URLs. The user just has to unpack it, and can view it locally.