标签:cWeb style http os java ar sp c amp
1、根据浏览器的性能
var is = {
ff: window.globalStorage,
ie: document.all && !window.opera,
ie6: !window.XMLHttpRequest,
ie7: document.all && window.XMLHttpRequest && !XDomainRequest && !window.opera,
ie8: document.documentMode==8,
opera: Boolean(window.opera),
chrome: Boolean(window.chrome),
safari: window.getComputedStyle && !window.globalStorage && !window.opera
}
2、通过解析navigator对象
如:var isFirefox=(navigator.userAgent.indexOf("Gecko")!==-1);
var isMacWebKit=(nacigator.userAgent.indexOf("Macintosh")!==-1 && navigator.userAgent.indexOf("WebKit"));
标签:cWeb style http os java ar sp c amp
原文地址:http://www.cnblogs.com/dunken/p/3994415.html