我想检测用户是否安装了skype,因为我正在使用此代码,但代码仅适用于Internet Explorer有任何方法可以为chrome做任何帮助。谢谢<谢谢
Jquery扩展
jQuery.extend({
skype : function(failureFunction) {
var $ = jQuery;
if ($.browser.safari || $.browser.opera) {
return true;
} else if ($.browser.msie) {
try {
if (new ActiveXObject("Skype.Detection")) return true;
} catch(e) { }
} else {
if (typeof(navigator.mimeTypes["application/x-skype"]) == "object") {
return true;
}
}
$('a[href^="skype:"]').click(function() {
failureFunction();
return false;
});
return false;
}
});
Javascript
jQuery(function($) {
$.skype(function() {
// this function gets called if they don't have skype.
alert("Looks like you don't have skype. Bummer.");
});
});
HTML
<a href="skype:your.skype.username?call">Call me</a>