0
<script>
/*@cc_on
   @if (@_jscript)
      alert("IE.");
   @else*/
      alert("Not IE.");
   /*@end
@*/
</script> 

When I ran the code above, Firefox and IE all showed a popup dialog that tell me "Not IE.". Why did this happend. Is @_jscript no longer defined in IE 11?

IE version: 11.0.9600.17501

inter18099
  • 103
  • 10
  • Yes IE is starting to support W3C standards, including dropping support for non standard browser sniffing. – Petah Jan 30 '15 at 07:08
  • Sorry. My English is not very good. So I didn't know the "conditional compilation" term and didn't search that question out. – inter18099 Jan 30 '15 at 09:43

1 Answers1

0

Did @_jscript no longer defined in IE 11?

No.

Few features in earlier versions of IE Is not Supported for IE10+ . It's Removed.

Instead of Using @_jscript You can try the following Code

 function msieversion()
{
  var ua = window.navigator.userAgent
  var msie = ua.indexOf ( "MSIE " )

  if ( msie > 0 )      // If Internet Explorer, return version number
     return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
  else                 // If another browser, return 0
     return 0

}

Reference

  • 2
    Please see http://stackoverflow.com/help/referencing for help on referencing things not written by you. As your answer is currently written, it sounds as though you were speaking on behalf of the IE team. – BoltClock Jan 30 '15 at 09:31
  • Thank you very much. IE make web programming a little hard I think... – inter18099 Jan 30 '15 at 09:31
  • Also, this has nothing to do with HTML5 parsing. – BoltClock Jan 30 '15 at 09:32