网页调用ActiveX 并且响应事件
classid为ActiveX的ID
假设ActiveX控件提供StartPreview方法,并且提供DblClick事件接口
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function PlayFrame(id_str,addr_str) //播放
{
var RealPlay=document.getElementById (id_str);
RealPlay.StartPreview(addr_str,2);
}
</script>
<script type="text/javascript" for="rv_active" event="DblClick()">
alert("双击");
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<object id="RealPlay0" name="rv_active" width="278" height="142" classid="CLSID:8D2C1672-F5B2-43CC-9A5E-2635BFF12BB8"></object>
</div>
</form>
<script language="JavaScript">PlayFrame('RealPlay0','rtsp://192.168.0.115:554/2/13/2-13.drv');</script>
</body>
</html>
classid为ActiveX的ID
假设ActiveX控件提供StartPreview方法,并且提供DblClick事件接口
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function PlayFrame(id_str,addr_str) //播放
{
var RealPlay=document.getElementById (id_str);
RealPlay.StartPreview(addr_str,2);
}
</script>
<script type="text/javascript" for="rv_active" event="DblClick()">
alert("双击");
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<object id="RealPlay0" name="rv_active" width="278" height="142" classid="CLSID:8D2C1672-F5B2-43CC-9A5E-2635BFF12BB8"></object>
</div>
</form>
<script language="JavaScript">PlayFrame('RealPlay0','rtsp://192.168.0.115:554/2/13/2-13.drv');</script>
</body>
</html>