JSDG 13.6


<script type="text/javascript">
/*@cc_on
  @if (@_jscript)
    // This code is inside a conditional comment, which is also a
    // regular JavaScript comment. IE runs it but other browsers ignore it.
    alert('You are using Internet Explorer);
  @else*/
    // This code is no longer inside a JavaScript comment, but is still
    // inside the IE conditional comment.  This means that all browsers
    // except IE will run this code.
    alert('You are not using Internet Explorer');
/*@end
  @*/
</script>

 按理说这是IE中javascript条件注释。

以/*@cc_on 开头,@*/结束的。而且JScript是Microsoft自己的JavaScript解释器的名字,而@_jscript变量在IE中为True。

但我在IE7中,似乎认不到条件注释。

firefox却可以。不知道是IE版本不对,还是怎么回事。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM