开发者

Double colons in function declaration in Javascript?

Today I found this code snippet:

<object ID="FF" CLASSID="clsid:guid" CODEBASE="url" VIEWASTEXT></obje开发者_如何学Cct>
<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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜