some common problems in using COM components (or ActiveX controls) in Web pages
1. Insert controls on the page
The easiest and most common way to invoke an ActiveX plug-in in an HTML page is to:
<object id= "Idname" classid= "clsid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" > </object>
The id attribute, like the ID of other elements in HTML, is the unique identifier of each element in the DOM tree. The ClassID attribute is a very critical attribute here, and it is through him that IE can correctly find the ActiveX to invoke. Each ActiveX has a unique ID to indicate that this is classid. 2. Using events in the control
Method 1:
function ok () {
...
}
document.getElementById (' Idname '). attachevent (' Eventname ', OK);
EventName is the event in the plug-in, OK () is the response function after the event is triggered.
Method 2:
function Idname::eventname (Parm1,parm2,,,) {
var a=parm1;
var B=parm2;
.......
}
The above code binds the event to the plug-in named Idname when the response of the EventName event is triggered. In the EventName event, returns PARMA1, Parma2 、、、 several parameters, which are used as arguments in the event response function.
Method 3:
<script Language = "javascript" type = "text/javascript" for = "idname" event = "Eventname (parm1,parm2,,,,)" >
......
......
</script>
Bind the response function with a for plug-in event.
Reference: http://blog.csdn.net/zfive5/article/details/6595001 http://bbs.csdn.net/topics/340116458 http:// Www.cnblogs.com/lidabo/archive/2012/11/05/2755453.html