检查是否已安装Silverlight [英] Checking is Silverlight is installed
本文介绍了检查是否已安装Silverlight的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用Silverlight独立存储的页面。现在,当我的页面加载时,它会显示一个超链接按钮,将用户重定向到Silverlight下载页面(如果他没有安装它)。
我怎么能阻止此链接进入?不仅仅是隐藏它,我如何完全阻止它?
Hi,
I have a page which makes use of Silverlight Isolated Storage. Now, when my page loads, it shows a hyperlink button that redirects the user to Silverlight download page (if he doesn't have it installed).
How can I prevent this link from coming at all? Like not just hiding it, how do I completely prevent it?
推荐答案
要查找是否有Silverlight使用此JS
To find if there is Silverlight use this JS
function hasSilverlight() {
try {
try {
// IE
var AgControl = new ActiveXObject('AgControl.AgControl');
return (true);
}
catch (e) {
// Others
if (navigator.plugins["Silverlight Plug-In"]) {
return(true);
}
}
}
catch (e) {
return (false);
}
}
如果函数返回true,则删除dom元素...
If the function returns true, then remove dom element...
var el = document.getElementById("button_id");
el.parentNode.removeChild(el);
这篇关于检查是否已安装Silverlight的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文