mirror of
https://github.com/jquery/jquery.git
synced 2026-02-03 17:45:19 -05:00
More changes to get jQuery in line with JSLint.
This commit is contained in:
10
src/core.js
10
src/core.js
@@ -18,7 +18,7 @@ var jQuery = function( selector, context ) {
|
||||
|
||||
// A simple way to check for HTML strings or ID strings
|
||||
// (both of which we optimize for)
|
||||
quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
|
||||
quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w\-]+)$/,
|
||||
|
||||
// Is it a simple selector
|
||||
isSimple = /^.[^:#\[\.,]*$/,
|
||||
@@ -623,12 +623,14 @@ jQuery.extend({
|
||||
},
|
||||
|
||||
grep: function( elems, callback, inv ) {
|
||||
var ret = [];
|
||||
var ret = [], retVal;
|
||||
inv = !!inv;
|
||||
|
||||
// Go through the array, only saving the items
|
||||
// that pass the validator function
|
||||
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
||||
if ( !inv !== !callback( elems[ i ], i ) ) {
|
||||
retVal = !!callback( elems[ i ], i );
|
||||
if ( inv !== retVal ) {
|
||||
ret.push( elems[ i ] );
|
||||
}
|
||||
}
|
||||
@@ -748,7 +750,7 @@ function doScrollCheck() {
|
||||
// If IE is used, use the trick by Diego Perini
|
||||
// http://javascript.nwbox.com/IEContentLoaded/
|
||||
document.documentElement.doScroll("left");
|
||||
} catch( error ) {
|
||||
} catch(e) {
|
||||
setTimeout( doScrollCheck, 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user