views:

2712

answers:

4

Is there a javascript function I can use to detect whether a specific silverlight version is installed in the current browser?

I'm particularly interested in the Silverlight 2 Beta 2 version. I don't want to use the default method of having an image behind the silverlight control which is just shown if the Silverlight plugin doesn't load.

Edit: From link provided in accepted answer:

Include Silverlight.js (from Silverlight SDK)

Silverlight.isInstalled("2.0");
A: 
var hasSilverlight = Boolean(window.Silverlight);

var hasSilverlight2 = hasSilverlight && Silverlight.isInstalled('2.0');

Etc....

pcorcoran
+5  A: 

Please actually use the latest script available at http://code.msdn.microsoft.com/silverlightjs for the latest updates. This has several fixes in it.

Tim Heuer
A: 

Download this script: http://code.msdn.microsoft.com/silverlightjs

And then you can use it like so:

if (Silverlight.isInstalled) { alert ("Congrats. Your web browser is enabled with Silverlight Runtime"); }

Deano