十年
<HTML> <H2>控件测试 </H2><p> <HR><center><P> <OBJECT id='TestOCX' classid="clsid:3753F975-368A-4A19-94CB-1E800D8215FA" codebase="TestOCX.ocx#version=1,0,0,0" > </OBJECT> <mce:script language=javascript><!-- //设置属性 function setCommName(comm) { TestOCX.CommName = comm; } //调用方法 function pay1(money) { var s=TestOCX.StartPay(money, txtWzh.value); if (s=='') s = '错误:' + TestOCX.Error; alert(s); } } // --></mce:script> 串口<select id='selectComm'><option value='COM1'>COM1</option><option value='COM2'>COM2</option></select> <input type=button value='设置串口' onclick='setCommName(document.all.selectComm.value);'> <input type=button value='读取串口设置' onclick='javascript:alert(TestOCX.CommName);'> <br><br> <input type=button value='消费' onclick='pay1(txtmoney.value);'> <input type=button value='清除日志' onclick='javascritp:spanmsg.innerText="";'> <br> <span id='spanmsg'></span> <mce:script language="javascript" for="TestOCX" event="OnMsg(AMsg)"><!-- //OCX事件回调函数 spanmsg.innerText=spanmsg.innerText + '/n' + AMsg; // --></mce:script> <br> </HTML>