SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
            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";
            document.getElementById('<%= ibtnHelp.ClientID %>').style.visibility = "hidden";
    window.onload = IsSLInstalled;
share|improve this question
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
Thanks Kit Menke.. – Mohammad Shabbir Ahmed Sep 15 '11 at 8:53
up vote 1 down vote accepted

Please use _spBodyOnLoadFunctionNames.push("IsSLInstalled");

Do not use window.onload = IsSLInstalled;


share|improve this answer
Thanks a lot.. it worked perfectly!! – Mohammad Shabbir Ahmed Sep 15 '11 at 8:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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