Javascript Internet Explorer+;Windows Phone IEMobile条件注释
所以我一直在使用这两种IE条件的组合:Javascript Internet Explorer+;Windows Phone IEMobile条件注释,javascript,html,internet-explorer,windows-phone-7,conditional-comments,Javascript,Html,Internet Explorer,Windows Phone 7,Conditional Comments,所以我一直在使用这两种IE条件的组合: <!--[if (IE)|(IEMobile)]> <script type="text/javascript"> // Do something </script> <![endif]--> <!--[if (!IE)|(!IEMobile)]> <script type="text/javascript"> // Do so
<!--[if (IE)|(IEMobile)]>
<script type="text/javascript">
// Do something
</script>
<![endif]-->
<!--[if (!IE)|(!IEMobile)]>
<script type="text/javascript">
// Do something else
</script>
<!--<![endif]-->
那么,这样的组合在生产环境中能起作用吗?我尝试使用IE 11进行测试,模拟任何以前版本的IE,结果如下:
- 第一个是为PC开发IE李>
- 第二个未能向IE for PC公开其内容李>
- 我没有测试IEMobile,因为我没有Windows Phone,所以我不能确定其中一些功能是否适用于它。 有什么建议吗
if(Modernizr.touch){
// Do something
} else {
// Do something else
}