aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-01-11 07:31:40 +0000
committerJohn Resig <jeresig@gmail.com>2007-01-11 07:31:40 +0000
commit74c06be3ea29d246194815342a79ea798ea56771 (patch)
treeba74f2e3330c9b12e97459251c73594dc0c3d23c
parent9449591eef44360b5bfdb9a23cea1f4a1a6f3c33 (diff)
downloadjquery-74c06be3ea29d246194815342a79ea798ea56771.tar.gz
jquery-74c06be3ea29d246194815342a79ea798ea56771.zip
Added a fix for $("object *") in IE7.
-rw-r--r--src/selector/selector.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/selector/selector.js b/src/selector/selector.js
index 4a6d1054e..e9e859e08 100644
--- a/src/selector/selector.js
+++ b/src/selector/selector.js
@@ -235,12 +235,20 @@ jQuery.extend({
// We need to find all descendant elements, it is more
// efficient to use getAll() when we are already further down
// the tree - we try to recognize that here
- for ( var i = 0, rl = ret.length; i < rl; i++ )
+ for ( var i = 0, rl = ret.length; i < rl; i++ ) {
+ // Grab the tag name being searched for
+ var tag = m[1] != "" || m[0] == "" ? "*" : m[2];
+
+ // Handle IE7 being really dumb about <object>s
+ if ( ret[i].nodeName.toUpperCase() == "OBJECT" && tag == "*" )
+ tag = "param";
+
jQuery.merge( r,
m[1] != "" && ret.length != 1 ?
jQuery.getAll( ret[i], [], m[1], m[2], rec ) :
- ret[i].getElementsByTagName( m[1] != "" || m[0] == "" ? "*" : m[2] )
+ ret[i].getElementsByTagName( tag )
);
+ }
// It's faster to filter by class and be done with it
if ( m[1] == "." && ret.length == 1 )