标签:
1 function getOs(url,title) { 2 3 var OsObject = ""; 4 5 if(navigator.userAgent.indexOf("MSIE")>0) { 6 7 return "MSIE"; 8 9 } 10 11 if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 12 13 return "Firefox"; 14 15 } 16 17 if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 18 19 return "Safari"; 20 21 } 22 23 if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 24 25 return "Camino"; 26 27 } 28 29 if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 30 31 return "Gecko"; 32 33 } 34 35 36 37 } 38 39 40 /*调用方法:*/ 41 alert("您的浏览器类型为:"+getOs());
标签:
原文地址:http://www.cnblogs.com/BaishangBloom/p/4642761.html