js调用activeX

<OBJECT id=CdmCtrl CLASSID="clsid:D3CA4563-F2A3-47AB-9831-0F77059DE336"></OBJECT> 
clsid为 odl文件中 coclass旁边的uuid

JS调用
function Open() 
{
var value_String = document.getElementsByName("Open_param1")[0].value;

var returnValue = CdmCtrl.Open(value_String);
document.getElementsByName("Open_result")[0].value = returnValue;

}

调用JS
<input type="button" name="button1" value="Open" onclick="Open()"/>

处理事件:
<SCRIPT type="text/javascript" FOR="CdmCtrl" EVENT="OnCashInStarted(p_lRetCode)" >
document.getElementsByName("log")[0].value += "fire OnCashInStarted(long p_lRetCode) event \n p_lRetCode = " + p_lRetCode + "\n\n";
</SCRIPT>

你可能感兴趣的:(ActiveX)