Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does IE use //@ in javascript for?

So, a bug in a piece of javascript revolved around code similar to :

<script>
    (function() {
        if (true) {
            //@todo: do we need to set total or -- ?
            alert('hello?');
        }
    })();
</script>

In the larger system IE complained "Expected ';' ". In the small scale example IE simply caused a warning about blocking ActiveX controls.

Obviously, "//@" has some context to activeX controls in IE. I was unable to find this as searching for the symbols was useless, and any search about special comments in IE result in the conditional html comments. I am just curious how the //@ are supposed to be used in IE.

like image 292
celadonz Avatar asked May 30 '12 19:05

celadonz


1 Answers

The IE JScript engine supports conditional comments which turn comments written in a particular way into code (partially). However, you are not using those.

In your case it seems to be a way to tell e.g. an IDE that there is a TODO item. The error you got is most likely unrelated.

like image 135
ThiefMaster Avatar answered Nov 09 '22 23:11

ThiefMaster