Javascript 检测Google Earth安装在Internet Explorer的网页中

Javascript 检测Google Earth安装在Internet Explorer的网页中,javascript,internet-explorer,google-earth,Javascript,Internet Explorer,Google Earth,是否可以在Internet Explorer的网页中检测是否使用Javascript在客户端计算机上安装了Google Earth应用程序 此页面是intranet上受信任站点的一部分 更新:通过创建ActiveX对象或任何特定于IE的javascript来检测它是很好的。我认为使用javascript不起作用。我很确定Google Earth没有在Internet Explorer(或任何其他浏览器)中安装插件。所以你可以忘记Javascript 由于您位于受信任的站点上,您可以尝试使用Act

是否可以在Internet Explorer的网页中检测是否使用Javascript在客户端计算机上安装了Google Earth应用程序

此页面是intranet上受信任站点的一部分


更新:通过创建ActiveX对象或任何特定于IE的javascript来检测它是很好的。

我认为使用javascript不起作用。我很确定Google Earth没有在Internet Explorer(或任何其他浏览器)中安装插件。所以你可以忘记Javascript


由于您位于受信任的站点上,您可以尝试使用ActiveX。我不喜欢ActiveX,但也许有一种方法可以更深入地了解客户机的系统。

是的,这是可能的-在html页面上调用API的init函数

<body onload="init()">
   bla bla bla 
</body>
最后,在该函数中检查错误代码

function failureCallback(errorCode)
{
    if (errorCode == "ERR_CREATE_PLUGIN") {
        alert("Plugin not installed")
    } else {
        alert("Other failure loading the Google Earth Plugin: " + errorCode);
    }
}
查看完整的工作代码

祝你好运
MikeD

谢谢。它似乎检测到了GE插件。当您安装常规GE时,是否安装了该软件?我想检测的是常规GE是否已安装。Matthewoops抱歉-似乎我误解了你的问题是-这检测到GE API插件否-这不检测是否安装了常规GE否-安装常规GE时未安装GE插件
function failureCallback(errorCode)
{
    if (errorCode == "ERR_CREATE_PLUGIN") {
        alert("Plugin not installed")
    } else {
        alert("Other failure loading the Google Earth Plugin: " + errorCode);
    }
}