Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/468.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如果ie6这么做,其他人就这么做。我该怎么做_Javascript_Asp.net_Css_Coding Style - Fatal编程技术网

Javascript 如果ie6这么做,其他人就这么做。我该怎么做

Javascript 如果ie6这么做,其他人就这么做。我该怎么做,javascript,asp.net,css,coding-style,Javascript,Asp.net,Css,Coding Style,我需要检查ie 6,如果是这样,请在本地加载所有js文件,或者加载任何更高或不同的ie chrome等,然后从cdn(谷歌或任何其他)加载 我已经在为样式使用条件注释 <!--[if lte IE 6]> <link href="Content/themes/bootstrap/css/bootstrap-ie6.css" rel="stylesheet" /> <link href="Content/Sit

我需要检查ie 6,如果是这样,请在本地加载所有js文件,或者加载任何更高或不同的ie chrome等,然后从cdn(谷歌或任何其他)加载

我已经在为样式使用条件注释

<!--[if lte IE 6]>          
     <link href="Content/themes/bootstrap/css/bootstrap-ie6.css" rel="stylesheet" />         
     <link href="Content/Site-ie6.css" rel="stylesheet" /> 
<![endif]-->

但我知道我们有很多用户使用ie6,所有这些用户都在同一个位置,需要从站点而不是cdn加载js文件。所以,如果ie6从本地站点加载js文件,其他任何东西都可以从cdn加载

我该怎么做

以下工作是否可行:

类似于:()


你在用别的东西!
谢谢

是的,那会有用的:

<!--[if lte IE 6]>
  You're using IE 6!
<![endif]-->
<![if ! lte IE 6]>
  You're using something else!
<![endif]>

你在用别的东西!
需要注意的一点是,不支持条件注释的旧浏览器会将其视为无效的HTML语法。因此,另一种方法是:

<!--[if lte IE 6]>
  You're using IE 6!
<![endif]-->
<!--[if !lte IE 6]>-->
  You're using something else!
<!--<![endif]-->

你在用别的东西!
编辑:

所以我想说如果不是IE6而是ie9,那么就从谷歌下载 cdn



使用AND运算符。如果所有子表达式的计算结果都为true,则返回true。我认为这
其他方法也可以。我不确定那是否是
!lte IE 6
语法是否正确。这里面有一些样品。最后,我完全同意下面的评论和达菲莫的回答。请使用现代化软件。但老实说,我甚至没有检查它从哪里来,或者它的作用。同样,如果它是cdn,那么它将不适用于这些特定的ie6用户。ie6用户有一个防火墙,阻止除我的网站之外的任何东西的访问。这是无法改变的。我会试试看。感谢您允许我对不同的脚本html5使用[if lt IE 9]和[!IE 6]。抱歉,我的最后一个问题不够清楚。你的第一个答案很完美。我只需要为html5做另一组脚本。所以我想说,如果ie9不是IE6,那么从谷歌cdn加载。谢谢我现在明白了,我修好了
<!--[if lte IE 6]>
  You're using IE 6!
<![endif]-->
<!--[if !lte IE 6]>-->
  You're using something else!
<!--<![endif]-->
<!--[if (lt IE 9)&(!IE 6)]>
Anything less than IE 9 except IE6
<![endif]-->