jQuery源码分析: 浏览器检测jQuery.uaMatch
// Useragent RegExp
var rwebkit = /(webkit)[ \/]([\w.]+)/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
browser = {},
// For matching the engine and version of the browser
browserMatch;
uaMatch: function( ua ) { //< ua = navigator.userAgent......
阅读全文