Head.js on if/endif scenarios

255 Views Asked by At

I would like to add the following lines that I currently have under the section using head.js.

<!--[if lt IE 9]>
<script type="text/javascript" src='@Url.Script("AdminScripts/html5.js")'></script>
<script type="text/javascript" src='@Url.Script("AdminScripts/PIE.js")'></script>
<script type="text/javascript" src='@Url.Script("AdminScripts/IE9.js")'></script>
<script type="text/javascript" src='@Url.Script("AdminScripts/ie.js")'></script>
<![endif]-->

Can anyone guide me how to do this? Here is an example of how I am adding other stuff.

head.js("@Url.Script("jquery-1.4.4.min.js")", function(){
head.js("@Url.Script("jquery.tools.min.js")");
});

However, when I try to add the if/end if lines of code, it keeps on giving me errors. Any help would be highly appreciated.

Thanks

1

There are 1 best solutions below

0
On

you can find all needed information to config your script for some version of IE browser in this documentation

In your case possible script cand be follow:

if (head.browser.ie && head.browser.version < 9) {
    /* code specific to IE but only if IE version is less than 9 */
}