I have a COM object that raises events and JavaScript on the web page to capture those events. It all works perfectly. Now I have to "distribute" this JavaScript to several other web applications for use on their web pages (this is all internal intranet stuff).
Here is the JavaScript function and script tag for the event sink:
<script for="ica" event="OnAgentEvents(evd)" language="javascript">
function ica::OnAgentEvents(evd) {
// do stuff here
}
</script>
How can I put this into a separate .js file? Or does it have to remain on the page itself?
The ica object is on the page in an object tag:
<object classid="clsid:55527FAD-5E60-4F44-867B-9F6E7B0DB9DD" id="ica" name="ica"></object>
<script>tag - I have a plain<script>tag with multipleobj::eventstyle handlers within it, leading me to think that they will be fine in a separate file.<script for= event= >with the actual code directly inside the<script>tag, orfunction objectName::eventName. Those are two different, independent mechanisms to achieve the same effect, they aren't supposed to be combined the way you try to.