I’ve seen this method of detecting IE in several online examples:
if (/*@cc_on!@*/false) { // check for Internet Explorer
Is this similar to the conditional comments IE recognizes in HTML?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This statement controls conditional compilation of comment contents in IE. If IE sees this comment, it actually compiles the contents of comment blocks as pure code. Now the trick happens with the
!in the comment.IE compiles the
!as if it were written into source so it handles the code asif (!false), while all other browsers treat it asif (false).