[英]Internet Explorer + Windows Phone IEMobile Conditional Comments
So I've been using these two combinations of IE conditionals: 因此,我一直在使用IE条件句的以下两种组合:
<!--[if (IE)|(IEMobile)]>
<script type="text/javascript">
// Do something
</script>
<![endif]-->
<!--[if (!IE)|(!IEMobile)]>
<script type="text/javascript">
// Do something else
</script>
<!--<![endif]-->
So could such combinations work in production environment? 这样的组合在生产环境中可以工作吗? I tried testing with IE 11 emulated to any previous version of IE and I got these results:
我尝试使用IE 11进行测试,以模拟到任何以前的IE版本,并得到以下结果:
I am not sure what you want to do, but you should give feature detection a change. 我不确定您要做什么,但是您应该对功能检测进行更改。 Instead of using browser detection.
而不是使用浏览器检测。 Try http://modernizr.com/ With it you can do something like that:
尝试使用http://modernizr.com/ ,您可以执行以下操作:
if(Modernizr.touch){
// Do something
} else {
// Do something else
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.