<HTML xmlns:IE>
<HEAD>
<STYLE>
@media all {
IE\:clientCaps {behavior:url(#default#clientcaps)}
}
</STYLE>
</HEAD>
<BODY>
<IE:clientCaps ID="oClientCaps" />
<SCRIPT>
bMSvmAvailable = oClientCaps.isComponentInstalled("{D27CDB6E-AE6D-11CF-96B8-444553540000}","ComponentID");
alert("是否安装了FLASH?---"+bMSvmAvailable);
</SCRIPT>
:
</BODY>
<HEAD>
<STYLE>
@media all {
IE\:clientCaps {behavior:url(#default#clientcaps)}
}
</STYLE>
</HEAD>
<BODY>
<IE:clientCaps ID="oClientCaps" />
<SCRIPT>
bMSvmAvailable = oClientCaps.isComponentInstalled("{D27CDB6E-AE6D-11CF-96B8-444553540000}","ComponentID");
alert("是否安装了FLASH?---"+bMSvmAvailable);
</SCRIPT>
:
</BODY>
obj= new ActiveXObject("ActiveXName");
}
catch (ex){
obj = null ;
}if (obj==null)
{
window.open("http://xxxx/xx.htm");
}
else
{}
我怎么知道应用程序的isComponentInstalled
如果没有ACTIVEX,也可人为地在安装时在注册表中加CLASSID.
我可不可以用javascript检查本机是否
装了QQ?如果安装了调用什么方法打开QQ聊天
窗口?
var id = args;
if (wangwangInstalled){
window.location="wangwang:SendIM?" + id;
}else if (document.all){
window.target="_blank";
//window.open("http://taobaoafp.allyes.com/main/adfclick?db=taobaoafp&bid=121,771,773&cid=0,0,0&sid=888&show=ignore&url=http://www.taobao.com/help/wangwang/tip.php", "", "width=422,height=210");
window.open("http://www.taobao.com/help/wangwang/wangwang.php", "", "");
}
}
检查QQ是否安装用http://im.qq.com/js/checkqqclient.js
或用我提供的方法查clsid:ED4CA2E5-0EEA-44C1-AD7E-74A07A7507A4"tencent" 是QQ的URL Protocol,我们熟知的URL Protocol有http,ftp,mailto
URL Protocol可以自定义的,就是写注册表啦。参见注表:HKEY_CLASSES_ROOT\HTTP 或HKEY_CLASSES_ROOT\TENCENT
[HKEY_CLASSES_ROOT\notenote]
"URL Protocol"="notepad.exe"
[HKEY_CLASSES_ROOT\notenote\DefaultIcon]
@="notepad.exe,1"
[HKEY_CLASSES_ROOT\notenote\shell\open\command]
@="notepad.exe"这样在IE地址栏中输入“notenote:”就会运行记事本程序
-----不行的,notepad.exe不是为URL Protocol而设计。
因为IE地址为notenote:c:\xx.txt时,notepad.exe得到的参数是“notenote:c:\xx.txt”而不是“c:\xx.txt”notepad.exe中没有去掉"notenote:"的处理过程。