5

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.

7
  • And just like that, SO borked the code snippet. Not cool. Commented May 31, 2011 at 10:00
  • after pasting in the code, select it all, and hit the {} button in the editor toolbar. Viola! The language hint isn't necessary, but sometimes helps. Commented May 31, 2011 at 10:11
  • 1
    possible duplicate of What does ‘::’ (double colon) do in javascript for events? Commented May 31, 2011 at 10:12
  • @sarnold I did! And the preview was fine. Commented May 31, 2011 at 10:17
  • 3
    @13xforever: Might I suggest you post the answer as an actual answer to your own question? That's perfectly acceptable :-) Commented May 31, 2011 at 10:29

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

There is this article on MSDN. Also, I've written a library to work the many limitations of these event handlers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.