function mycontrol_ReadACard(CardNo)
   {alert(CardNo)
   }

解决方案 »

  1.   

    不知道你是怎么试的!<button onclick=mycontrol_ReadACard("Test!")>Test</button>
    <script>
    function mycontrol_ReadACard(str)
       {alert(str)
       }
    </script>
      

  2.   

    可能错了两个字,更正!
    本人用VC做了一个读IC卡的控件,想在HTML里面使用,但是不知道如何用JAVASCRIPT响应控件产生的事件,并取回控件事件回传的参数。在VB里面的调用代码如下:
    Sub mycontrol_ReadACard(CardNo as String)
         msgbox CardNo
    End Sub
    这样就可以得到控件线程刚刚得到的卡号,但是JAVASCRIPT的该如何写呢?主要是这个事件参数该如何在JAVASCRIPT里面得到?
            谢谢
      

  3.   

    在VB里面的调用代码如下你是在VB还是VBS下调用的?
      

  4.   

    晕!那当然不行,去看看activeX和脚本语言的通信吧,也许有结果。
      

  5.   

    参见:http://expert.csdn.net/Expert/topic/1417/1417044.xml?temp=1.806277E-02
    <script language="JavaScript">
    function YourJsFunction(param1,param2,..)
    {
    //......
    }YourActiveXControlID.ItsActiveX事件Name=YourJsFunction;
    </script>
      

  6.   

    参数可以加上试试,一般不用参数,用activex的属性来传递