Wednesday, August 12, 2009

How To Detect Silverlight Installed In Client Machine

<html>
    <body>
        <script language="javascript">
        var browser = navigator.appName;
        var SLInstalled = false;
        if (browser == 'Microsoft Internet Explorer')
        {
            try
            {
                var slControl = new ActiveXObject('AgControl.AgControl');//IE
                SLInstalled = true;
            }
            catch (e)
            {
                SLInstalled = false;
            }
        }
        else
        {   
            try
            {
                if (navigator.plugins["Silverlight Plug-In"]) // Other Than IE
                {
                    SLInstalled = true;
                }
            }
            catch (e)
            {
                SLInstalled = false;
            }
        }
            if(SLInstalled == true)
            {
                    alert('Silverlight Installed');
            }
            else
            {
                  alert('Silverlight Not Installed');
             }
        </script>
    </body>
</html>




No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.