例子代码如下所示:
<SCRIPT LANGUAGE="VBScript">
<!--
Function OCXTest()
OCXTest = 1
dim ocx
on error resume next
err.clear
set ocx = createobject("I_FLEXGRID.FlexGridCtrl.2")
set ocx = nothing
if err <> 0 then
OCXTest = 0
err.clear
exit function
end if
set ocx = createobject("LEDGER50_I.Ledger50Ctrl_I.1")
set ocx = nothing
if err <> 0 then
OCXTest = 0
err.clear
exit function
end if
End function
//-->
</SCRIPT>
<Script language="JavaScript">
var setup = OCXTest();
if (setup==0) //客户端未安装控件,打开自解压包的链接提示用户下载安装
{
window.open("cab/instgb.exe");
window.open("cab/dssview.exe");
}
</script>