Question

Is it possible in web page on Internet Explorer to detect if the Google Earth application is installed on the client machine using Javascript?

This page is part of a Trusted Site on an intranet.

Update: detecting it via creating an ActiveX object or any IE specific javascript is fine.

Was it helpful?

Solution

I don't think this works using Javascript. I'm pretty sure Google Earth doesn't install a plugin into Internet Explorer (or any other browser for that matter). So you can forget Javascript.

As you are on a trusted site you may try using ActiveX. I'm not into ActiveX but maybe there's a way to have a deeper look into the client's system.

OTHER TIPS

yes it is possible - on your html page you call the init function for the API

<body onload="init()">
   bla bla bla 
</body>

In a JavaScript, when creating a GE instance for your page, you provide a function pointer for a callback function called on errors

function init()
{
    if (ge == null)
    {
        google.earth.createInstance("content", initCallback, failureCallback);
    }
}

finally - in that function you check the error code

function failureCallback(errorCode)
{
    if (errorCode == "ERR_CREATE_PLUGIN") {
        alert("Plugin not installed")
    } else {
        alert("Other failure loading the Google Earth Plugin: " + errorCode);
    }
}

look at this for a complete working code.

Good luck MikeD

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top