javascript函数直接调用的问题
发布网友
发布时间:2022-04-24 02:32
我来回答
共1个回答
热心网友
时间:2022-04-24 04:01
你的这些代码 我做了修改。可以直接观看。修改处 我做了标记:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<% dim aa,dk
aa="60.21.218.4"
dk="8000" %>
<script language="javascript">
var UserID
function Play()
{
var Netocx = document.getElementById("NetOCX");
UserID = Netocx.Login("<% =aa %>",<% =dk %>,"admin","12345");
Netocx.StartRealPlay(0 ,0, 0);
}
function Stop()
{
var Netocx = document.getElementById("NetOCX");
Netocx.StopRealPlay();
Netocx.Logout();
}
function FullScreen()
{
var Netocx = document.getElementById("NetOCX");
Netocx.FullScreenCtrl();
}
//不需要return paly ()
//return paly ()
</script>
</head>
<body>
<table width="1024" height="19" border="0">
<tr>
<td width="1024" height="15"> </td>
</tr>
</table>
<table width="789" height="681" border="0">
<tr>
<td height="314" colspan="3" align="center"><object classid="clsid:CAFCF48D-8E34-4490-8154-026191D73924" codebase="../codebase/NetVideoActiveX23.cab#version=2,3,6,1"
standby="Waiting..." id="NetOCX" width="400" height="300" name="ocx" align="center" >
</object></td>
<td height="314" colspan="3" align="center"> </td>
</tr>
<tr>
<td width="73" height="55" rowspan="3"> </td>
<td width="267" height="23" align="center">
<input type="button" name="Play" value=" 预览 " onClick = "Play()" >
<input type="button" name="Stop" value=" 停止 " onClick = "Stop()" > </td>
<script language="javascript">
//页面加载完毕。即可Play();故页面最后再加上个script来调用Play();
Play();
</script>