you can write standard COM events, or manuplate the Internet Explorer from within the ActiveX. reference http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcconeventhandlingincom.asp http://support.microsoft.com/kb/172763/EN-US/
ActiveX的只能由脚本调用,不能自己激发
测试代码如下,现在的测试代码能响应控件的Click事件,我想在控件中添加自定义的的事件,在接收到数据包时触发该事件,以让页面作出响应。不知道这样该如何实现?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title><style type="text/css">
<!--
.front1 {
font-size: 12px;
font-weight: normal;
}
-->
</style>
</head>
<BODY>
<OBJECT id="OcxTest" classid="clsid:193444F9-613E-424D-84BC-5BE8B2403B22"><PARAM NAME="internal" VALUE="500"></OBJECT>
<SCRIPT LANGUAGE="JavaScript1.2" FOR="OcxTest" EVENT="Click">
<!--
alert("ccccccc");
-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Login()
{
alert("bbbbbb");
OcxTest.Start();
}
//-->
</SCRIPT>
<P>
<INPUT id=button1 type=button name=button1 onclick="Login()">
</P>
<font color=blue>运行之前请先注册控件!</font><br>
Activex控件事件激发测试
</BODY>
</HTML>
reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcconeventhandlingincom.asp
http://support.microsoft.com/kb/172763/EN-US/
<!--
alert("ccccccc");
-->
</SCRIPT>
楼主,这个脚本是否支持所有的activex控件?