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
14b09024
Commit
14b09024
authored
Oct 17, 2006
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and tests for appending HTML options to select elements.
Fixed previous tests for 193 and 170.
parent
6f7cd669
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
index.html
build/test/index.html
+1
-1
jquery.js
src/jquery/jquery.js
+8
-3
No files found.
build/test/index.html
View file @
14b09024
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
<option
id=
"option3d"
value=
"3"
>
3
</option>
<option
id=
"option3d"
value=
"3"
>
3
</option>
</select>
</select>
</form>
</form>
<
p
id=
"floatTest"
>
Float test.
</div
>
<
b
id=
"floatTest"
>
Float test.
</b
>
</div>
</div>
</dl>
</dl>
...
...
src/jquery/jquery.js
View file @
14b09024
...
@@ -539,7 +539,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -539,7 +539,7 @@ jQuery.fn = jQuery.prototype = {
* $('#floatTest').css({cssFloat: 'left'});
* $('#floatTest').css({cssFloat: 'left'});
* ok( $('#floatTest').css('cssFloat') == 'left', 'Modified CSS float using "cssFloat": Assert float is left');
* ok( $('#floatTest').css('cssFloat') == 'left', 'Modified CSS float using "cssFloat": Assert float is left');
* $('#floatTest').css({'float': 'right'});
* $('#floatTest').css({'float': 'right'});
* ok( $('#floatTest').css('
cssFloat') == 'right', 'Modified CSS float using "cssF
loat": Assert float is right');
* ok( $('#floatTest').css('
float') == 'right', 'Modified CSS float using "f
loat": Assert float is right');
* $('#floatTest').css({'font-size': '30px'});
* $('#floatTest').css({'font-size': '30px'});
* ok( $('#floatTest').css('font-size') == '30px', 'Modified CSS font-size: Assert font-size is 30px');
* ok( $('#floatTest').css('font-size') == '30px', 'Modified CSS font-size: Assert font-size is 30px');
*
*
...
@@ -568,7 +568,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -568,7 +568,7 @@ jQuery.fn = jQuery.prototype = {
* $('#floatTest').css('cssFloat', 'right');
* $('#floatTest').css('cssFloat', 'right');
* ok( $('#floatTest').css('cssFloat') == 'right', 'Modified CSS float using "cssFloat": Assert float is right');
* ok( $('#floatTest').css('cssFloat') == 'right', 'Modified CSS float using "cssFloat": Assert float is right');
* $('#floatTest').css('float', 'left');
* $('#floatTest').css('float', 'left');
* ok( $('#floatTest').css('
cssFloat') == 'left', 'Modified CSS float using "cssF
loat": Assert float is left');
* ok( $('#floatTest').css('
float') == 'left', 'Modified CSS float using "f
loat": Assert float is left');
* $('#floatTest').css('font-size', '20px');
* $('#floatTest').css('font-size', '20px');
* ok( $('#floatTest').css('font-size') == '20px', 'Modified CSS font-size: Assert font-size is 20px');
* ok( $('#floatTest').css('font-size') == '20px', 'Modified CSS font-size: Assert font-size is 20px');
*
*
...
@@ -701,6 +701,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -701,6 +701,7 @@ jQuery.fn = jQuery.prototype = {
* @test var defaultText = 'Try them out:'
* @test var defaultText = 'Try them out:'
* var result = $('#first').append('<b>buga</b>');
* var result = $('#first').append('<b>buga</b>');
* ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
* ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
* ok( $('#select3').append('<option value="appendTest">Append Test</option>').find('option:last-child').attr('value') == 'appendTest', 'Appending html options to select element');
*
*
* @name append
* @name append
* @type jQuery
* @type jQuery
...
@@ -764,6 +765,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -764,6 +765,7 @@ jQuery.fn = jQuery.prototype = {
* @test var defaultText = 'Try them out:'
* @test var defaultText = 'Try them out:'
* var result = $('#first').prepend('<b>buga</b>');
* var result = $('#first').prepend('<b>buga</b>');
* ok( result.text() == 'buga' + defaultText, 'Check if text prepending works' );
* ok( result.text() == 'buga' + defaultText, 'Check if text prepending works' );
* ok( $('#select3').prepend('<option value="prependTest">Prepend Test</option>').find('option:first-child').attr('value') == 'prependTest', 'Prepending html options to select element');
*
*
* @name prepend
* @name prepend
* @type jQuery
* @type jQuery
...
@@ -1546,7 +1548,10 @@ jQuery.extend({
...
@@ -1546,7 +1548,10 @@ jQuery.extend({
var
table
=
""
;
var
table
=
""
;
if
(
!
a
[
i
].
indexOf
(
"<thead"
)
||
!
a
[
i
].
indexOf
(
"<tbody"
)
)
{
if
(
!
a
[
i
].
indexOf
(
"<opt"
)
)
{
table
=
"thead"
;
a
[
i
]
=
"<select>"
+
a
[
i
]
+
"</select>"
;
}
else
if
(
!
a
[
i
].
indexOf
(
"<thead"
)
||
!
a
[
i
].
indexOf
(
"<tbody"
)
)
{
table
=
"thead"
;
table
=
"thead"
;
a
[
i
]
=
"<table>"
+
a
[
i
]
+
"</table>"
;
a
[
i
]
=
"<table>"
+
a
[
i
]
+
"</table>"
;
}
else
if
(
!
a
[
i
].
indexOf
(
"<tr"
)
)
{
}
else
if
(
!
a
[
i
].
indexOf
(
"<tr"
)
)
{
...
...
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