使用 Silverlight 进行渐进式增强
我可以使用 Javascript 检测客户端是否具有在页面中运行 Silverlight 部分所需的运行时,并加载(如果有),否则在该区域留下静态图像或其他内容?
我想向页面添加一些 Silverlight,但它不是页面的重要部分,因此如果他们没有安装它,我宁愿默默地退回到纯粹的 Web 标准内容,而不是放置一些要求他们安装的东西。
Can I detect with Javascript if the client has the needed runtime to run a Silverlight section in a page, and load if if they do, otherwise leave a static image or something in that area?
I would like to add some Silverlight to a page, but it's not an important part of the page so I would rather just silently fall back to pure web standard stuff if they don't have it installed rather than putting up something that asks them to install it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标准示例页面(例如当您从 Visual Studio 运行 silverlight 应用程序时构建的页面)可以为您处理此问题。
请注意,当对象标签无法实例化与该类型关联的对象时,它会呈现内部 html。因此可以修改内部 html 以显示您认为合适的后备内容。
The standard example page such as the one built when you run a silverlight app from visual studio handles this for you.
Note that when an object tag is unable instance the object associated with the type it renders inner html present instead. So could modify the inner html to display what ever you feel is an appropriate fallback.