stmllr.net

IE once again sucks

by on stmllr.net

On some of our websites, we use conditional comments to control CSS hacks for Internet Explorer. If you create static copies of a website (or mirror), never forget that only IE will follow the @import links inside conditional controls - tools like httrack or wget certainly will not, because they know how to behave! This fact cost me almost an hour today.

Tags

Comments

  1. Russell

    Hi there, an old post I know. Did you ever get wget/httrack to fetch IE specific CSS from IE's conditional comments?

  2. Steffen

    Sorry Russell, I did not. If you ever find a solution, please leave a comment about it.

  3. Thomas Worm

    You can use HTTrack's "extended parsing" and put a fake JavaScript in your site. This looks like:


    <!-- CSS fixes for IE in offline version -->
    <!--[if gte IE 6]>
    <link rel="stylesheet" type="text/css" href="/fileadmin/templates/styles/ie6.css" media="all" />
    <![endif]-->
    <!--[if gte IE 7]>
    <link rel="stylesheet" type="text/css" href="/fileadmin/templates/styles/ie7.css" media="all" />
    <![endif]-->
    <!--[if gte IE 9]>
    <link rel="stylesheet" type="text/css" href="/fileadmin/templates/styles/ie9.css" media="all" />
    <![endif]-->
    <script type="text/javascript">
    function fakeForHTTrack() {
    location.href = 'fileadmin/templates/datev/styles/ie6.css';
    location.href = 'fileadmin/templates/datev/styles/ie7.css';
    location.href = 'fileadmin/templates/datev/styles/ie9.css';
    }
    </script>


    HTTrack then finds the files in the faked JavaScript funktion and will download them. It's a really dirty workaround but it works.

Add a comment

Comments are moderated and need to approved. Please be patient.