The firefox browser calls the ocx method written in C ++, firefoxocx
Ocx method written in C ++ in firefox
When communicating with hardware or third-party controls, the BS architecture usually uses JS scripts to call the OCX plug-in. This method can be used in IE browsers. The IE version must be later than 6.0 and earlier than 11.0. Before calling OCX, You need to register the Registry command: regsvr32 ***. ocx; put the DLL files required by OCX in the same directory. The following is an example code:
<HTML>
<HEAD>
<TITLE> MyActiveX </TITLE>
</HEAD>
<Script language = "javascript">
Function playIPC ()
{
// Alert (URL );
Document. getElementById ("MyActiveX"). PlayVideo_HK ("1", "192.168.0.17", "8000", "admin", "12345", "1 ");
}
</Script>
<Object id = "MyActiveX"
WIDTH = 0 HEIGHT = 0 classid = "clsid: A61DC0B2-A661-4BEE-86C8-ED96684AC8A4">
>
</OBJECT>
<Input type = "button" value = "playIPC" onclick = "playIPC ()"/>
>
</HTML>
In Firefox, this call method is not available. To use Firefox and other browsers, perform the following operations:
(1) install Firefox.
(2) download the following three files: ffactivex-setup-r39.exe, axhost. r39.xpi, chrome. r39.crx.
(3) Open the firefox browser, drag axhost. r39.xpi into the browser, register it, and restart firefox.
(4) modify the JS script code that calls OCX. The sample code above is changed:
<HTML>
<HEAD>
<TITLE> MyActiveX </TITLE>
</HEAD>
<Script language = "javascript">
Function playIPC ()
{
// Alert (URL );
Document. getElementById ("MyActiveX"). PlayVideo_HK ("1", "192.168.0.17", "8000", "admin", "12345", "1 ");
}
</Script>
<Object id = "MyActiveX" type = "application/x-itst-activex"
WIDTH = 0 HEIGHT = 0
Clsid = "{A61DC0B2-A661-4BEE-86C8-ED96684AC8A4}">
>
</OBJECT>
<Input type = "button" value = "playIPC" onclick = "playIPC ()"/>
>
</HTML>
After modification, it can be used in Firefox and Google Chrome.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.