通过javascript检测是否安装了Silverlight

问题描述:

我是否可以使用javascript函数来检测当前浏览器中是否安装了特定的Silverlight版本?

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

我对Silverlight 2 Beta特别感兴趣2版。我不想使用默认方法在Silverlight控件后面显示一个图像,如果Silverlight插件没有加载,就会显示。

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.

编辑:从接受的答案中提供的链接:

From link provided in accepted answer:

包含Silverlight.js(来自Silverlight SDK)

Include Silverlight.js (from Silverlight SDK)

Silverlight.isInstalled("2.0");


包含Silverlight.js(来自Silverlight SDK)

Include Silverlight.js (from Silverlight SDK)

Silverlight.isInstalled(4.0)

资源:

http://msdn.microsoft.com/en-us/library/cc265155(vs.95).aspx