开发者

Head.js on if/endif scenarios

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("jqu开发者_Python百科ery.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


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 */
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜