1

I'm trying to simplify an IE ActiveX project into a single.js file and I'm having some trouble with ActiveX events

The project has them defined as but I would like to move the entire script tag into the js file and allow people to add an EventListener to the event if they need to be notified of it.

<script for="Component" event="TargetEvent(args)" language="javascript">Component_TargetEvent(args)</script>

Trying to bind the the event itself has not worked. I have tried the following items but I still get a "Uncaught SyntaxError: Unexpected token ." and "Uncaught SyntaxError: Unexpected token :" respectively.

function Component.TargetEvent(args){}

function Component::TargetEvent(args){}
3
  • 1
    Not sure if I understand your question, but what about Component.TargetEvent = function(args){};? Commented Jun 17, 2016 at 18:41
  • That fixed it, you da man! Commented Jun 17, 2016 at 18:43
  • Okay, well I've made an answer. You're free to accept it if that's all that was needed. Commented Jun 17, 2016 at 18:46

1 Answer 1

1

Use

Component.TargetEvent = function(args) {};
Sign up to request clarification or add additional context in comments.

1 Comment

The hero we all want.

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.