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
5fae4969
Commit
5fae4969
authored
Apr 25, 2007
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #1086: Append all caps HTML tags
parent
958bed09
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
coreTest.js
src/jquery/coreTest.js
+9
-5
jquery.js
src/jquery/jquery.js
+1
-1
No files found.
src/jquery/coreTest.js
View file @
5fae4969
...
@@ -404,18 +404,18 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
...
@@ -404,18 +404,18 @@ test("append(String|Element|Array<Element>|jQuery)", function() {
ok
(
pass
,
"Test for appending a DOM node to the contents of an IFrame"
);
ok
(
pass
,
"Test for appending a DOM node to the contents of an IFrame"
);
reset
();
$
(
'#select1'
).
appendTo
(
'#foo'
);
t
(
'Append select'
,
'#foo select'
,
[
'select1'
]
);
reset
();
reset
();
$
(
'<fieldset>'
).
appendTo
(
'#form'
).
append
(
'<legend id="legend">test</legend>'
);
$
(
'<fieldset>'
).
appendTo
(
'#form'
).
append
(
'<legend id="legend">test</legend>'
);
t
(
'Append legend'
,
'#legend'
,
[
'legend'
]
);
t
(
'Append legend'
,
'#legend'
,
[
'legend'
]
);
reset
();
$
(
'#select1'
).
append
(
'<OPTION>Test</OPTION>'
);
ok
(
$
(
'#select1 option:last'
).
text
()
==
"Test"
,
"Appending <OPTION> (all caps)"
);
});
});
test
(
"appendTo(String|Element|Array<Element>|jQuery)"
,
function
()
{
test
(
"appendTo(String|Element|Array<Element>|jQuery)"
,
function
()
{
expect
(
5
);
expect
(
6
);
var
defaultText
=
'Try them out:'
var
defaultText
=
'Try them out:'
$
(
'<b>buga</b>'
).
appendTo
(
'#first'
);
$
(
'<b>buga</b>'
).
appendTo
(
'#first'
);
ok
(
$
(
"#first"
).
text
()
==
defaultText
+
'buga'
,
'Check if text appending works'
);
ok
(
$
(
"#first"
).
text
()
==
defaultText
+
'buga'
,
'Check if text appending works'
);
...
@@ -435,6 +435,10 @@ test("appendTo(String|Element|Array<Element>|jQuery)", function() {
...
@@ -435,6 +435,10 @@ test("appendTo(String|Element|Array<Element>|jQuery)", function() {
expected
=
"This link has class=
\"
blog
\"
: Simon Willison's WeblogTry them out:Yahoo"
;
expected
=
"This link has class=
\"
blog
\"
: Simon Willison's WeblogTry them out:Yahoo"
;
$
(
"#first, #yahoo"
).
appendTo
(
'#sap'
);
$
(
"#first, #yahoo"
).
appendTo
(
'#sap'
);
ok
(
expected
==
$
(
'#sap'
).
text
(),
"Check for appending of jQuery object"
);
ok
(
expected
==
$
(
'#sap'
).
text
(),
"Check for appending of jQuery object"
);
reset
();
$
(
'#select1'
).
appendTo
(
'#foo'
);
t
(
'Append select'
,
'#foo select'
,
[
'select1'
]
);
});
});
test
(
"prepend(String|Element|Array<Element>|jQuery)"
,
function
()
{
test
(
"prepend(String|Element|Array<Element>|jQuery)"
,
function
()
{
...
...
src/jquery/jquery.js
View file @
5fae4969
...
@@ -1479,7 +1479,7 @@ jQuery.extend({
...
@@ -1479,7 +1479,7 @@ jQuery.extend({
// Convert html string into DOM nodes
// Convert html string into DOM nodes
if
(
typeof
arg
==
"string"
)
{
if
(
typeof
arg
==
"string"
)
{
// Trim whitespace, otherwise indexOf won't work as expected
// Trim whitespace, otherwise indexOf won't work as expected
var
s
=
jQuery
.
trim
(
arg
),
div
=
doc
.
createElement
(
"div"
),
tb
=
[];
var
s
=
jQuery
.
trim
(
arg
)
.
toLowerCase
()
,
div
=
doc
.
createElement
(
"div"
),
tb
=
[];
var
wrap
=
var
wrap
=
// option or optgroup
// option or optgroup
...
...
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