首先在页面加入avtivex
代码如下:
<object classid="clsid:B094CE95-40EA-4798-99DC-4B8CE548121F" height="100%" width="100%" id="UiMonitor"> </object>
javascript 代码
代码如下:
<%--使用activex事件--%>
<script type="text/javascript" language="jscript" for="UiMonitor" event="CommMsg(videoID,uMsgCode,bsMsgBody)">
myfunction(videoID,uMsgCode,bsMsgBody);
</script>
<script language="javascript" type="text/javascript">
<%--activex事件的具体操作--%>
function myfunction(videoID, uMsgCode, bsMsgBody) {
alert(videoID);
}
function test()
{
//首先创建一个avtivex对象
var UiMonitor = document.getElementById("UiMonitor");
//获取或设置activex属性
UiMonitor.RunMode=“1”;
//调用activex方法
var videoID=UiMonitor.AddMonitor(deviceid, playAddr, 0);
}
</script>
activex控件
activex
JavaScript