Javascript 判断是否安装QQ,MSN,Skype

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
	   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   
    </head>
   <body>
   <script type="text/javascript">
   function checkInstalled = function(m) {
	   switch(m){
	   	case 'msn':
	   		try {
				new ActiveXObject("MSNMessenger.P4QuickLaunch");
				return true;
			    }catch (e) {
				return false;
	   		    }
		case 'skype':
	   		try{
	   			new ActiveXObject("Skype.Detection");
	   			return true;
	   		}catch(e){
	   			return false;
	   		}
	   	case 'qq':
	   		try {
	   			new ActiveXObject("TimwpDll.TimwpCheck");
	   			return true;
	   		}catch (e) {
	   			return false;
	   		}
	   }
   }
</script> <input type="button" value="检测有没有安装MSN" onclick="alert(checkInstalled('msn'))" /> <input type="button" value="检测有没有安装QQ" onclick="alert(checkInstalled('qq'))" /> <input type="button" value="检测有没有安装SKYPE" onclick="alert(checkInstalled('skype'))" /> </body> </html>

你可能感兴趣的:(JavaScript,Install,qq,check)