Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6181345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:00:18+00:00 2026-05-24T01:00:18+00:00

An ActiveX control is being loaded conditionally based on browser and other factors. In

  • 0

An ActiveX control is being loaded conditionally based on browser and other factors.

In order to handle events from the ActiveX control, a simple jquery .bind('Event', ...) won’t work. Instead, it seems to me that my only choice is to use <script ... for='myPlugin' event='Event'></script> style binding.

1) It seems that if the script tag statically part of the HTML and is loaded before the control exists on the page, then IE won’t fire the event
2) Hard-coding the object IDs is unacceptable if there needed to be (dynamically) multiple instances of the plugin

But when I add the following code, I get “‘param1’ is undefined” immediately, before the event should fire (I’m almost certain that it is not in response to the event firing).

$('HEAD').append($('<script language="javascript" ' +
    'type="text/javascript" for="myPlugin" event="Event(param1)">' + 
    '$('#myPlugin').triggerHandler("jQueryBoundEvent", [ param1 ]);' +
'<' + '/script>'));

From the web, I’ve gathered that jQuery interfere’s with adding script tags and rather eval()s them. That would explain the unbound param1 and the immediate execution of the script. The script’s for and event attributes are lost during the eval().

Is there another approach to load the plugin dynamically, and attach to it’s events without hardcoding the handlers?

=======

Alternatively, it seems from various posts that even though $.bind() doesn’t work for ActiveX and XPI plugins, that attachEvent() or addEventListener() should work. Is this the case? I haven’t been able to confirm it for a dynamically added plugin.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:00:20+00:00Added an answer on May 24, 2026 at 1:00 am

    Try appendTo('head') instead of $('head').append(...

    I know JQuery say they’re basically identical except for the order, but IE disagrees and prefers appendTo() when injecting scripts into the head.

    Try this:

    var plugin_html = '$("#myPlugin").triggerHandler("jQueryBoundEvent", [ param1 ]);';
    $('<script />').attr(
    {
        type: 'text/javascript',
        for: 'myPlugin',
        event: 'Event(param1)'
    }).html(plugin_html).appendTo($('head'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got an ActiveX Control that gets an image from a fingerprint device
We are using the Sharepoint.OpenDocuments.EditDocument2 ActiveX control and method. The method is being called
I have an activeX control that contains one window that has streaming video being
I have a situation where an ActiveX control is loaded into an iframe on
I want to upgrade an ActiveX control from VB6 to VB.NET. I'm having trouble
I have an ActiveX control written using the MS ATL library and I am
I'm creating an ActiveX control that will be used in web pages to query
I created an activeX control to perform some actions, which take about 1 minute.
I have an ActiveX control (an OCX file) which raises an event. I want
I created an ActiveX control ocx file using Visual Studio 2008. Then tried registering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.