Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double colons in function declaration in Javascript?

Today I found this code snippet:

<object ID="FF" CLASSID="clsid:guid" CODEBASE="url" VIEWASTEXT></object>
<object ID="FileSaver" CLASSID="clsid:guid" CODEBASE="url" VIEWASTEXT></object>
…
<script language="javascript">
    function FileSaver::OnFinished(Status){…}
    function FF::OnFinished(Status){…}
</script>

I can't find anything relevant to explain this syntax. Is it really javascript? Is it correct? If not, how the code should look like?

This is a single page without external script links. Note that function declarations are directly inside <script> block.

like image 775
13xforever Avatar asked Oct 11 '22 21:10

13xforever


1 Answers

Thanks for everyone who looked into this.

Anyway, just as one could expect, not after five minutes after submitting the question, I found How to handle an ActiveX event in Javascript question about ActiveX callback handlers in IE, so it answers the main part of the question. As well, as the question that @outis has linked.

But I can't find any documentation on MSDN and that's troubling.

Conclusion: this is IE-specific ECMAScript extension for event handler declaration.

like image 112
13xforever Avatar answered Oct 16 '22 14:10

13xforever