Check
whether Silverlight is installed in your system or not
Hi Friends,
In the below article i will tell you how to check whether silverlight is installed in your system or not.
Copy the below code and paste into
the blank notepad file and save as "HTML" extension
after running the page click on Check Silverlight link.
<html>
<head>
<script language="javascript">
function ShowMessage()
{
if(checkSilverlight()==true)
{
alert("SilverLight installed.");
}
else
{
alert("SilverLight Not installed.");
}
}
function checkSilverlight()
{
var browser = navigator.appName; // Get browser
varsilverlightInstalled = false;
if (browser == 'Microsoft Internet Explorer')
{
try
{
varslControl = new ActiveXObject('AgControl.AgControl');
silverlightInstalled = true;
}
catch (e)
{
// Error. Silverlight not installed.
}
}
else
{
// Handle Netscape, FireFox, Google chrome etc
try
{
if (navigator.plugins["Silverlight Plug-In"])
{
silverlightInstalled = true;
}
}
catch (e)
{
// Error. Silverlight not installed.
}
}
return silverlightInstalled;
//alert(silverlightInstalled);
}
</script>
</head>
<body>
<a href="javascript:void(ShowMessage())">Check Silverlight</a>
</body>
</html>
after running the page click on Check Silverlight link.
<html>
<head>
<script language="javascript">
function ShowMessage()
{
if(checkSilverlight()==true)
{
alert("SilverLight installed.");
}
else
{
alert("SilverLight Not installed.");
}
}
function checkSilverlight()
{
var browser = navigator.appName; // Get browser
varsilverlightInstalled = false;
if (browser == 'Microsoft Internet Explorer')
{
try
{
varslControl = new ActiveXObject('AgControl.AgControl');
silverlightInstalled = true;
}
catch (e)
{
// Error. Silverlight not installed.
}
}
else
{
// Handle Netscape, FireFox, Google chrome etc
try
{
if (navigator.plugins["Silverlight Plug-In"])
{
silverlightInstalled = true;
}
}
catch (e)
{
// Error. Silverlight not installed.
}
}
return silverlightInstalled;
//alert(silverlightInstalled);
}
</script>
</head>
<body>
<a href="javascript:void(ShowMessage())">Check Silverlight</a>
</body>
</html>
Happy Programming ! !
If you have any query mail me to Sujeet.bhujbal@gmail.com
Regards
Sujeet Bhujbal
------------------------------------------------------------------------------------------------------------
Personal Website :-http://sujitbhujbal.wordpress.com/
Facebook :-www.facebook.com/sujit.bhujbal
CodeProject:-http://www.codeproject.com/Members/Sujit-Bhujbal
Linkedin :-http://in.linkedin.com/in/sujitbhujbal
Stack-Exchange: http://stackexchange.com/users/469811/sujit-bhujbal
Twitter :-http://twitter.com/SujeetBhujbal
JavaTalks :-http://www.javatalks.com/Blogger/sujit9923/
------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment