Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
127c0b8a
Commit
127c0b8a
authored
Aug 27, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the issue where $("body").find("div#foo") would ignore the specified tag name. (Bug #1543)
parent
3ae74b52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
selector.js
src/selector/selector.js
+1
-1
selectorTest.js
src/selector/selectorTest.js
+3
-1
No files found.
src/selector/selector.js
View file @
127c0b8a
...
@@ -247,7 +247,7 @@ jQuery.extend({
...
@@ -247,7 +247,7 @@ jQuery.extend({
// We need to find all descendant elements
// We need to find all descendant elements
for
(
var
i
=
0
;
ret
[
i
];
i
++
)
{
for
(
var
i
=
0
;
ret
[
i
];
i
++
)
{
// Grab the tag name being searched for
// Grab the tag name being searched for
var
tag
=
m
[
1
]
!=
""
||
m
[
0
]
==
""
?
"*"
:
m
[
2
];
var
tag
=
m
[
1
]
==
"#"
&&
m
[
3
]
?
m
[
3
]
:
m
[
1
]
!=
""
||
m
[
0
]
==
""
?
"*"
:
m
[
2
];
// Handle IE7 being really dumb about <object>s
// Handle IE7 being really dumb about <object>s
if
(
tag
==
"*"
&&
ret
[
i
].
nodeName
.
toLowerCase
()
==
"object"
)
if
(
tag
==
"*"
&&
ret
[
i
].
nodeName
.
toLowerCase
()
==
"object"
)
...
...
src/selector/selectorTest.js
View file @
127c0b8a
...
@@ -41,7 +41,7 @@ test("broken", function() {
...
@@ -41,7 +41,7 @@ test("broken", function() {
});
});
test
(
"id"
,
function
()
{
test
(
"id"
,
function
()
{
expect
(
2
4
);
expect
(
2
5
);
t
(
"ID Selector"
,
"#body"
,
[
"body"
]
);
t
(
"ID Selector"
,
"#body"
,
[
"body"
]
);
t
(
"ID Selector w/ Element"
,
"body#body"
,
[
"body"
]
);
t
(
"ID Selector w/ Element"
,
"body#body"
,
[
"body"
]
);
t
(
"ID Selector w/ Element"
,
"ul#first"
,
[]
);
t
(
"ID Selector w/ Element"
,
"ul#first"
,
[]
);
...
@@ -72,6 +72,8 @@ test("id", function() {
...
@@ -72,6 +72,8 @@ test("id", function() {
t
(
"ID Selector on Form with an input that has a name of 'id'"
,
"#lengthtest"
,
[
"lengthtest"
]
);
t
(
"ID Selector on Form with an input that has a name of 'id'"
,
"#lengthtest"
,
[
"lengthtest"
]
);
t
(
"ID selector with non-existant ancestor"
,
"#asdfasdf #foobar"
,
[]
);
// bug #986
t
(
"ID selector with non-existant ancestor"
,
"#asdfasdf #foobar"
,
[]
);
// bug #986
isSet
(
$
(
"body"
).
find
(
"div#form"
),
[],
"ID selector within the context of another element"
);
});
});
test
(
"class"
,
function
()
{
test
(
"class"
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment