What Is a Shiv and What Does It Do?


*This post may contain affiliate links. As an Amazon Associate we earn from qualifying purchases.

What Is a Shiv?

You might have read about HTML shivs or shims on the internet. But what is a shiv anyway? And most importantly, what does it do? Well, a HTML shiv is actually a JavaScript code that enables users to style HTML5 elements in Internet Explorer versions older than IE9, which do not support HTML5.

Think of the shiv as a means of translating modern code to old versions of Internet Explorer. Shivs generate a fake interface that reshapes HTML5 code in a way that old IE versions can read it and run it. As you can imagine, this type of tool became necessary to keep old browsers in line with new codes.

So, Is It Shiv or Shim?

What is a shiv and what is a shim? As it turns out, they are the exact same thing. Due to some online mishap, this JavaScript code became widely known as a shiv, in spite of the fact that the IT specialist who came up with the code meant to call it a shim. So whenever you see the terms HTML shim and HTML shiv, the main thing you should know is that they are the same thing.

what is a shiv

All About HTML Shims and How to Download Them

HTMLshivs, HTML5 shims, IE shims, or whatever you want to call them are essential if you are dealing with an old version of Internet Explorer. Everything you have to do is download the Webshim Library and you will find all the HTML5 shivs you need to deal with any type of data.

HTML shivs are extremely easy to use. Essentially, all you have to do is add a code (the shiv) in your webpage?s head section. It?s supposed to go between the <head> and </head> tags. The shiv looks something like this:


<!–[if lt IE 9]>

<script src=”http://HTML5shiv.googlecode.com/svn/trunk/HTML5.js”>

</script>

<![endif]–>


Is the HTML Shiv the Same as the Polyfill?

The answer to this one is no. HTML shivs and polyfills are not the same thing because only shims can translate new code to old Internet Explorer. To make a long story short, you code will run on IE even without the polyfill. However, without the HTML5 shim, it won?t be able to.

what is a shiv

Image Sources: 1,?2

Recent Posts