I have an issue with editing a Sharepoint page.
I have to check whether Silverlight is installed in the user's system which is done by a Javascript function, but the issue I'm getting after implementing this is I'm unable to edit the page and the items in the Ribbon are disabled.
Here is the code:
This is what I have
<script language="javascript" type="text/javascript">
function IsSLInstalled()
{
var isSilverlightInstalled = false;
var slControl;
//check on IE
try
{
slControl = new ActiveXObject('AgControl.AgControl');
isSilverlightInstalled = true;
}
catch (e)
{
//either not installed or not IE. Check Firefox
if (navigator.plugins["Silverlight Plug-In"])
{
isSilverlightInstalled = true;
}
}
if (isSilverlightInstalled == true)
{
document.getElementById('<%= ibtnHelp.ClientID %>').style.visibility = "visible";
}
else
{
document.getElementById('<%= ibtnHelp.ClientID %>').style.visibility = "hidden";
}
}
window.onload = IsSLInstalled;
</script>
