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
5c6c9936
Commit
5c6c9936
authored
Nov 28, 2007
by
David Serduke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #1714 by adding a default empty string if the value is falsey.
parent
0a755f6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
core.js
src/core.js
+1
-1
core.js
test/unit/core.js
+3
-1
No files found.
src/core.js
View file @
5c6c9936
...
@@ -396,7 +396,7 @@ jQuery.fn = jQuery.prototype = {
...
@@ -396,7 +396,7 @@ jQuery.fn = jQuery.prototype = {
// Everything else, we just grab the value
// Everything else, we just grab the value
}
else
}
else
return
this
[
0
].
value
.
replace
(
/
\r
/g
,
""
);
return
(
this
[
0
].
value
||
""
)
.
replace
(
/
\r
/g
,
""
);
}
}
...
...
test/unit/core.js
View file @
5c6c9936
...
@@ -881,9 +881,11 @@ test("$.extend(Object, Object)", function() {
...
@@ -881,9 +881,11 @@ test("$.extend(Object, Object)", function() {
});
});
test
(
"val()"
,
function
()
{
test
(
"val()"
,
function
()
{
expect
(
2
);
expect
(
3
);
ok
(
$
(
"#text1"
).
val
()
==
"Test"
,
"Check for value of input element"
);
ok
(
$
(
"#text1"
).
val
()
==
"Test"
,
"Check for value of input element"
);
ok
(
!
$
(
"#text1"
).
val
()
==
""
,
"Check for value of input element"
);
ok
(
!
$
(
"#text1"
).
val
()
==
""
,
"Check for value of input element"
);
// ticket #1714 this caused a JS error in IE
ok
(
$
(
"#first"
).
val
()
==
""
,
"Check a paragraph element to see if it has a value"
);
});
});
test
(
"val(String)"
,
function
()
{
test
(
"val(String)"
,
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