0

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>
  • we definitely need to take a look at your js and the way you added it to the page – Ivan Padabed Sep 14 '11 at 11:20
  • @Mohammad: I've edited your post for you to include the code. – Kit Menke Sep 14 '11 at 13:49
1

Please use _spBodyOnLoadFunctionNames.push("IsSLInstalled");

Do not use window.onload = IsSLInstalled;

Bye

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.