IE条件注释不在aspx页面中工作

时间:2015-11-05 05:39:03

标签: asp.net internet-explorer webforms conditional-comments

我想使用IE条件注释来加载基于IE版本的Angular脚本。但条件注释不起作用,因为角度未定义,它会抛出错误?谁能帮我这个? IE条件注释在<asp:content>标记内不起作用?

<asp:Content ID="Content2" ContentPlaceHolderID="ScriptSection" runat="server">

    <!--[if lt IE 9]>
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular-1.2.16.min.js")%>' type="text/javascript"></script>
<![endif]-->

    <!--[if gte IE 9]>
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular.min.js")%>' type="text/javascript"></script>
<![endif]-->
</asp:Content>

1 个答案:

答案 0 :(得分:1)

<![if IE]>   
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular-1.2.16.min.js")%>' type="text/javascript"></script>
<![endif]>

<![if IE]>   
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular.min.js")%>' type="text/javascript"></script>
<![endif]>