Php 一些Javascript是否可以检测是否安装了Cisco Jabber?
我已经编写了一个协议处理程序来启动Cisco Jabber设备。下面是我的代码Php 一些Javascript是否可以检测是否安装了Cisco Jabber?,php,javascript,jquery,html,Php,Javascript,Jquery,Html,我已经编写了一个协议处理程序来启动Cisco Jabber设备。下面是我的代码 <input onclick="javascript:window.location.href = 'movi:12345' type="button" value="Launch" /> 以下HTML文件应满足您的需要,请确保更改jQuery源文件链接以满足您自己的需要(在head标记中): var protocolCheckerTimer=false; var installerSites=
<input onclick="javascript:window.location.href = 'movi:12345'
type="button" value="Launch" />
以下HTML文件应满足您的需要,请确保更改jQuery源文件链接以满足您自己的需要(在head标记中):
var protocolCheckerTimer=false;
var installerSites=[];
var currentProtocol=false;
var protocolFound=false;
var-poppingUp=false;
$(文档).ready(函数(e){
$(window.bind('blur',interceptProtocolStartup);
$(document).bind('focusout',interceptProtocolStartup);
installerSites['movi']='https://supportforums.cisco.com/docs/DOC-23292';
installerSites['sip']='http://www.linphone.org/eng/download/packages/';
installerSites['skype']='http://www.skype.com/en/download-skype/skype-for-computer/';
installerSites['glow']='http://www.glowpoint.com';
$('a.protoco_handler')。单击(函数(e){
var sUrl=$(this.attr('href');
var urlComponents=sUrl.split(“:”);
currentProtocol=urlComponents[0];
日志('检查'+currentProtocol'的协议);
protocolCheckerTimer=setTimeout(waitForProtocolHandler,200);
$('hidIFrame').attr('src',sUrl);
返回false;
});
});
函数waitForProtocolHandler(){
如果(protocolFound==true){
resetAll();
返回;
}
poppingUp=true;
if(确认('未找到协议'+currentProtocol+'的处理程序。是否要安装?')){
日志('打开安装程序站点'+安装程序站点[currentProtocol]+'用于协议'+currentProtocol]);
打开(installerSites[currentProtocol]);
}
resetAll();
}
函数resetAll(){
protocolFound=false;
currentProtocol=false;
if(protocolCheckerTimer!==false){
clearTimeout(protocolCheckerTimer);
protocolCheckerTimer=false;
}
poppingUp=假;
}
函数interceptProtocolStartup(){
如果(poppingUp==真){
返回;
}
日志(“找到协议,清除超时”);
resetAll();
}
函数日志(msg){
if(window.console){
控制台日志(msg);
}
}
重复
<html>
<head>
<script type='text/javascript' src='jquery-1.5.1.js'></script>
<script type='text/javascript'>
var protocolCheckerTimer = false;
var installerSites = [];
var currentProtocol = false;
var protocolFound = false;
var poppingUp = false;
$(document).ready(function (e){
$(window).bind('blur', interceptProtocolStartup);
$(document).bind('focusout', interceptProtocolStartup);
installerSites['movi'] = 'https://supportforums.cisco.com/docs/DOC-23292';
installerSites['sip'] = 'http://www.linphone.org/eng/download/packages/';
installerSites['skype'] = 'http://www.skype.com/en/download-skype/skype-for-computer/';
installerSites['glow'] = 'http://www.glowpoint.com';
$('a.protoco_handler').click(function (e) {
var sUrl = $(this).attr('href');
var urlComponents = sUrl.split(':');
currentProtocol = urlComponents[0];
log('checking protocol for ' + currentProtocol);
protocolCheckerTimer = setTimeout(waitForProtocolHandler, 200);
$('#hidIFrame').attr('src', sUrl);
return false;
});
});
function waitForProtocolHandler() {
if (protocolFound === true) {
resetAll();
return;
}
poppingUp = true;
if (confirm('Handler for protocol ' + currentProtocol + ' not found. Would you like to install?')) {
log('opening installer site ' + installerSites[currentProtocol] + ' for protocol ' + currentProtocol);
window.open(installerSites[currentProtocol]);
}
resetAll();
}
function resetAll() {
protocolFound = false;
currentProtocol = false;
if (protocolCheckerTimer !== false) {
clearTimeout(protocolCheckerTimer);
protocolCheckerTimer = false;
}
poppingUp = false;
}
function interceptProtocolStartup() {
if (poppingUp === true) {
return;
}
log('protocol found, clearing timeout');
resetAll();
}
function log(msg) {
if (window.console) {
console.log(msg);
}
}
</script>
</head>
<body>
<ul>
<li><a class='protoco_handler' href='movi:100001@ovcloud.com'>Launch Jabber</a></li>
<li><a class='protoco_handler' href='sip:azam@ovcloud.com'>Launch Cisco</a></li>
<li><a class='protoco_handler' href='skype:mdaliazam'>Launch Skype</a></li>
<li><a class='protoco_handler' href='glow:azam@ovcloud.com'>Launch Glowpoint :)</a> </li>
</ul>
<iframe id='hidIFrame' style='display:none'></iframe>
</body>
</html>