Changeset 1573
- Timestamp:
- 03/24/07 02:54:24 (2 years ago)
- Files:
-
- 1 modified
-
trunk/jquery/src/selector/selector.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/selector/selector.js
r1406 r1573 220 220 } 221 221 222 var last = ret[ret.length-1]; 223 222 224 // Try to do a global search by ID, where we can 223 if ( m[1] == "#" && ret[ret.length-1].getElementById ) {225 if ( m[1] == "#" && last && last.getElementById ) { 224 226 // Optimization for HTML document case 225 var oid = ret[ret.length-1].getElementById(m[2]);227 var oid = last.getElementById(m[2]); 226 228 227 229 // Do a quick check for the existence of the actual ID attribute 228 230 // to avoid selecting by the name attribute in IE 229 231 if ( jQuery.browser.msie && oid && oid.id != m[2] ) 230 oid = jQuery('[@id="'+m[2]+'"]', ret[ret.length-1])[0];232 oid = jQuery('[@id="'+m[2]+'"]', last)[0]; 231 233 232 234 // Do a quick check for node name (where applicable) so
