Skip to content
Browse files

Fix the loop

  • Loading branch information...
1 parent 49219ce commit ed2ad7fc63815c318bb3a4b258bce78048064bb4 @louisremi committed Aug 20, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 jquery.browser.js
View
6 jquery.browser.js
@@ -2,18 +2,18 @@
var ua = navigator.userAgent.toLowerCase(),
match,
- i = 0,
// Useragent RegExp
rbrowsers = [
/(chrome)[ \/]([\w.]+)/,
/(safari)[ \/]([\w.]+)/,
/(opera)(?:.*version)?[ \/]([\w.]+)/,
/(msie) ([\w.]+)/,
/(mozilla)(?:.*? rv:([\w.]+))?/
- ];
+ ],
+ i = rbrowsers.length;
$.browser = {};
-while ( i++ < rbrowsers.length ) {
+while ( i-- ) {
if ( (match = rbrowsers[i].exec( ua )) && match[1] ) {
$.browser[ match[1] ] = true;
$.browser.version = match[2] || "0";

0 comments on commit ed2ad7f

Please sign in to comment.
Something went wrong with that request. Please try again.