Script commented out

Haven’t done any scripting in over 10 yrs. I was on hlml.net site going over their html5 tutorials.

I’m stuck on a bit of script it said to copy/paste, it seems to be commented out (1st problem). Next thing is, it says load it in your browser and wait, I’ve been waiting two days. And yes I do know it wont work if its commented out.

I only want this resolved at this point because its frustrating and I have never done any js.
Any help appreciated

<html>

  <head>
    <!--[if lt IE 9]>
    <script
    src="html5shiv.js">
    </script>
    <![endif]-->
    <title>My first HTML5 page!</title>
  </head>

  <body>
    <p>This is my new HTML5 page.</p>
  </body>

</html>

Hi @slimpickings, the comment’s purpose in that script is to load only for Internet Explorer where the version is less than 9 : if lt IE 9
So it is some kind of polyfill for older browsers. Potentially your problem is somewhere else. Have you checked in the developer console in the browser for JavaScript errors? And what browser and version number are you using?

1 Like

Welcome to the forums.

1 Like

I do understand what it is for and I’m using Google Chrome so wasn’t really expecting anything to happen.

Am I wrong in thinking it is commented out ??

Only other issue I have is this that was directly under the bit of script
Quote:
Open your browser and type CTRL+O, browse to the file you just saved and choose it. Your browser should now be showing you your new HTML5 page. Pretty much the same as always. But just wait…

END QUOTE

Who would put “But just wait…” in a tutorial if something wasn’t going to happen. Thats as frustrating as having to clean up my dogs poop all the time.

And thanks for your reply

I agree that the “but just wait” is enigmatic.

My best guess is that it is meant as a lead in to the next chapter that has newer html5 tags that older browsers would not recognize without the shiv. In other words, it’s very short for “though the page looks like any other html page you’ve seen so far, the next chapter of the tutorial will demonstrate that pages with newer elements will not look like you would expect the html page to look if you don’t include the shiv.”

TBH, that tutorial is a bit dated and I’m thinking that unless you need to support very old browsers you most likely will not need to use the shiv. It may have been useful for when html5 was taking shape and browsers were catching up, but AFAIK, that time is now history.

2 Likes

Thanks for the reply, in the bin with that.

Bit off subject but, dude you have been around this forum (site point) for a long time. I remember you from probably 10 yrs ago. And always helpful.

Again, thanks for the reply

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.