SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict beebs93's Avatar
    Join Date
    Jul 2010
    Location
    Vancouver, Canada
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE9 and HTC files

    Source: Release Notes

    HTCs / VBScript
    HTML Components (HTC) and VBScript code when used inside of an IE9 or IE10 standards mode page are no longer executed in compatibility view.
    Consequently, DOM APIs used by the HTC or VBScript code now behave according to the IE standards mode version of the same APIs.
    However, the MS HTC documentation has several examples of basic HTC implementation that works on IE9 (eg. Microsoft MouseOver Hilite Sample)

    I tried to copy over the exact same example MS used and place all the necessary files on my server (My MouseOver Hilite Sample), but it doesn't work on IE9.

    I tried a simpler version, but it also didn't work (Testing IE9 HTC).

    While viewing the Developer Tools window, all three examples show the same browser mode (IE9) and the same document mode (Quirks).

    The only difference I can find is when I have Fiddler2 loaded to log the headers.

    Microsoft HTC Example:


    My Microsoft HTC Example:


    My Simple HTC Example:


    As you can see, the HTC file is not even being loaded on the pages on my server, but is on the MS site.

    I've tried adjusting the security settings via Internet Options in IE9, but no luck. All three examples work in IE8, though...

    Have I forgotten something basic like adding a semi-colon somewhere or is it more complex like I need to be facing south by southwest while chanting the Star Wars theme music as I'm about to sacrifice a goat?
    Attached Images Attached Images
    "To be truly dedicated to something
    you must be willing to betray it.
    " -SW

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    The example page and your page are both loading in quirks mode in IE9.

    Try using a strict doctype, rather than transitional.

    Going in another direction, this might work instead of relying on an HTC file, but it seems to be a little glitchy in IE9

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <style type="text/css">
        li:hover {
            color:red;
            font-weight:bold;
        }
    </style>
    </head>
    <body>
        <ul>
            <li>test</li>
            <li>test 2</li>
        </ul>
    </body>
    </html>
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Addict beebs93's Avatar
    Join Date
    Jul 2010
    Location
    Vancouver, Canada
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Changing to strict DTD didn't help, but thanks for the suggestion.

    To clarify, the final goal isn't just to achieve a hover state on list item elements. I'm working on patching an old independent CMS that was written before FF, Opera, Chrome, etc. had any real market share (yup, really). It relies on some HTC files and they obviously are not working properly on IE9. I'm trying to narrow down the why my simple examples don't work, but MS's does.
    "To be truly dedicated to something
    you must be willing to betray it.
    " -SW

  4. #4
    SitePoint Addict beebs93's Avatar
    Join Date
    Jul 2010
    Location
    Vancouver, Canada
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To add to the confusion, I tried loading the TwinHelix PNG fix and it loaded the HTC file in IE9.

    TwinHelix Fiddler2 log:


    I noticed it had the Stict DTD and I even tried copying the exact code from <HTML> to </HEAD>, but my own test sites still didn't load the HTC file.

    I can FEEL the error is something so flippin' small I'll probably throw up in my hands in disgust and retire from development (for all of 5 minutes; before I get sucked back in).
    Attached Images Attached Images
    "To be truly dedicated to something
    you must be willing to betray it.
    " -SW

  5. #5
    SitePoint Addict beebs93's Avatar
    Join Date
    Jul 2010
    Location
    Vancouver, Canada
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A minor breakthrough:

    I noticed that upon clearing my IE9 cache (and everything else I could clear) Fiddler showed that the HTC files did in fact load for my test pages on the first load only, thus, IE9 does recognize the behavior rule and on my test server it is simply caching the HTC file.

    I am, however, back to the original problem as to WHY Microsoft's test page actually executes the HTC file while my version does not.
    "To be truly dedicated to something
    you must be willing to betray it.
    " -SW

  6. #6
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by beebs93 View Post
    I noticed it had the Stict DTD and I even tried copying the exact code from <HTML> to </HEAD>, but my own test sites still didn't load the HTC file.
    The doctype is supposed to be the first line in your HTML docment--even before the <html> tag

    Quote Originally Posted by beebs93 View Post
    I can FEEL the error is something so flippin' small I'll probably throw up in my hands in disgust and retire from development (for all of 5 minutes; before I get sucked back in).
    Is the file path incorrect?
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,484
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by beebs93 View Post
    I'm trying to narrow down the why my simple examples don't work, but MS's does.
    I've just done the same as you and copied the microsoft page and the htc file file and I get the same results as you. The page works in IE8 but fails in IE9 whereas the same microsoft page (html and css) works in both.

    I wonder if IE9 needs something extra in the mime type for htc files.

  8. #8
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    I wonder if IE9 needs something extra in the mime type for htc files.
    I was just working on something last week were I used css3pie's HTC file in IE9. It worked fine without any extra code.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  9. #9
    SitePoint Addict beebs93's Avatar
    Join Date
    Jul 2010
    Location
    Vancouver, Canada
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    I've just done the same as you and copied the microsoft page and the htc file file and I get the same results as you. The page works in IE8 but fails in IE9 whereas the same microsoft page (html and css) works in both.

    I wonder if IE9 needs something extra in the mime type for htc files.
    I eliminated any differences except the type of server; Apache vs. IIS.

    A quick search resulted in this post, added the proper MIME type and voi-freakin'-la it worked.

    All of my troubles solved by a single Apache command line.

    Damn you Paul - I want the last six hours of my life back 'cause I bet you knew that the instant you read my post!
    "To be truly dedicated to something
    you must be willing to betray it.
    " -SW


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •