2

Possible Duplicate:
Why /*@ isn't a comment in JavaScript?

In the HTML5Shiv script the entire file appears to be commented out, but wrapped with an @ ("at" sign, "ampersat" etc) prior to the */.

Snippet: /*@cc_on(function....this, document)@*/

I haven't come across this before and couldn't find any references to how this works on the HTML5Shiv sites or after searching Google/StackOverfow, but have a feeling it's somehow to trick the browser to only work in IE?

Does anybody know why it's coded this way?

http://html5shiv.googlecode.com/svn/trunk/html5.js

http://code.google.com/p/html5shiv/

Community
  • 1
  • 1
jjurisch
  • 103
  • 8

2 Answers2

0

It's an IE-specific feature: Conditional comments. It marks blocks of code that should only be executed in IE.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
0

It's called conditional compilation and is a "feature" of older IE browsers. You can read up more on the Wikipedia article.

Alex Turpin
  • 46,743
  • 23
  • 113
  • 145