简体   繁体   English

如果IE条件注释不起作用

[英]if IE conditional comments not working

It seems like a silly question, but I'm stumped. 这似乎是一个愚蠢的问题,但我很困惑。

I'm using an if IE conditional statement to fix some issues in IE6. 我正在使用if IE条件语句来解决IE6中的某些问题。

In the head, I have 在头上,我有

<!--[if lt IE 7] > <script type="text/javascript" src="js/ie6.js"></script> < ![endif]-->

And in the ie6.js file, I have a simple alert, which works when I take it out of the conditional comment. 在ie6.js文件中,我有一个简单的警报,当我将其从条件注释中删除时,该警报将起作用。 But in IE, the alert does not show. 但是在IE中,警报不会显示。 I am testing on IE 6.0.2900 on Windows XP in Parallels Desktop. 我正在Parallels Desktop的Windows XP上的IE 6.0.2900上进行测试。

Try it without spaces in the tags: 试试看,标签中不要包含空格:

<!--[if lt IE 7]>
According to the conditional comment this is Internet Explorer lower than 7
<![endif]-->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM