SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML5 shiv wont work in Internet Explorer

    I am trying to create my very first HTML5 website and I am having problems trying to get it to work in IE.

    I have tried modernizr and html5 shiv and I cannot get either to render my webpage properly.

    Here is a link to the website

    As you can see when you load the page nothing appears in Internet Explorer 8

    Has anyone got any ideas as to why I cannot get my javascript to create the document elements for IE?

    edit:
    I just got rid of the shiv completely and added this code


    Code:
    <script>document.createElement("header")</script>
    <script>document.createElement("nav")</script>
    <script>document.createElement("article")</script>
    <script>document.createElement("figure")</script>
    <script>document.createElement("footer")</script>
    This seemed to fix this problem for all versions of IE except for IE7

    Anyone know how I can tweak this to get it to work for IE7? This is the second most popular version of IE for this website and I have to support it.

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    You haven't added the closing script tag here:

    Code:
    <!--[if lt IE 9]>
    <script type="text/javascript" src="http://www.users.on.net/~nova/html5/js/CreateHTML5Elements.js"></script>
    <![endif]-->
    See if that makes a difference.

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2006
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, thought it would be something stupid like a typo or lack of a closing tag.

    It seems the issue I was having with IE7 was more to do with a bug with IEtester, I ran a sandboxed version of IE7 and tested it in that and it ran fine.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    I just checked your site again and its not working in any version of IE (apart from ie9 which isn't getting that script rule).

    I see you haven't added the closing script tag as I mentioned which I'm sure will fix the issue (at least t did when I copied your page locally and added it in. )

  5. #5
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Also, you don't need separate <script></script> tags in there - just put it all into a single one.

    This word "shiv" really bothers me. Seems like a silly made-up buzzword for something that just used to be called a "workaround", "fix" or "hack".

  6. #6
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,053
    Mentioned
    66 Post(s)
    Tagged
    0 Thread(s)
    Isn't 'shiv' slang for a homemade knife, especially one made in prison?

  7. #7
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    Isn't 'shiv' slang for a homemade knife, especially one made in prison?
    Maybe they meant 'shim'.

    "...a washer or thin strip of material used to align parts, make them fit, or reduce wear."

    Then again, some people do harbour violent thoughts about IE.

  8. #8
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^ God only knows!

    Better, I would like a 5 five minute rounds in the octagon for IE!

  9. #9
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You can use either shiv or shim. They're identical.

    http://code.google.com/p/html5shim/
    http://code.google.com/p/html5shiv/


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
  •