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
f0189d61
Commit
f0189d61
authored
Feb 15, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the issue where weird characters were being used in ID selectors. Fixes jQuery bug #3913.
parent
22c9c9b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
selector.js
src/selector.js
+1
-1
index.html
test/index.html
+1
-0
selector.js
test/unit/selector.js
+3
-1
No files found.
src/selector.js
View file @
f0189d61
...
...
@@ -6,7 +6,7 @@
*/
(
function
(){
var
chunker
=
/
((?:\((?:\([^
()
]
+
\)
|
[^
()
]
+
)
+
\)
|
\[(?:\[[^
[
\]]
*
\]
|
[
'"
][^
'"
]
*
[
'"
]
|
[^
[
\]
'"
]
+
)
+
\]
|
\\
.|
[^
>+~,(
\[]
+
)
+|
[
>+~
])(\s
*,
\s
*
)?
/g
,
var
chunker
=
/
((?:\((?:\([^
()
]
+
\)
|
[^
()
]
+
)
+
\)
|
\[(?:\[[^
[
\]]
*
\]
|
[
'"
][^
'"
]
*
[
'"
]
|
[^
[
\]
'"
]
+
)
+
\]
|
\\
.|
[^
>+~,(
\[
\\
]
+
)
+|
[
>+~
])(\s
*,
\s
*
)?
/g
,
done
=
0
,
toString
=
Object
.
prototype
.
toString
;
...
...
test/index.html
View file @
f0189d61
...
...
@@ -50,6 +50,7 @@
<p
id=
"sap"
>
This link has
<code><a
href=
"#2"
id=
"anchor2"
>
class="blog"
</a></code>
:
<a
href=
"http://simon.incutio.com/"
class=
"blog link"
id=
"simon"
>
Simon Willison's Weblog
</a></p>
</div>
<span
id=
"name+value"
></span>
<p
id=
"first"
>
Try them out:
</p>
<ul
id=
"firstUL"
></ul>
<ol
id=
"empty"
></ol>
...
...
test/unit/selector.js
View file @
f0189d61
...
...
@@ -69,7 +69,7 @@ test("broken", function() {
});
test
(
"id"
,
function
()
{
expect
(
2
7
);
expect
(
2
8
);
t
(
"ID Selector"
,
"#body"
,
[
"body"
]
);
t
(
"ID Selector w/ Element"
,
"body#body"
,
[
"body"
]
);
t
(
"ID Selector w/ Element"
,
"ul#first"
,
[]
);
...
...
@@ -105,6 +105,8 @@ test("id", function() {
t
(
"Underscore ID"
,
"#types_all"
,
[
"types_all"
]
);
t
(
"Dash ID"
,
"#fx-queue"
,
[
"fx-queue"
]
);
t
(
"ID with weird characters in it"
,
"#name
\\
+value"
,
[
"name+value"
]
);
});
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