diff options
author | John Resig <jeresig@gmail.com> | 2007-01-08 01:17:28 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2007-01-08 01:17:28 +0000 |
commit | d0e8a2452ebd30abe403d402e813513cef675694 (patch) | |
tree | 7f497dd702cee0c4afeedb9fa84b753cd4030a2d /src | |
parent | b603ca03c460bad9d8cf367ddc0f18ef46a2ef2d (diff) | |
download | jquery-d0e8a2452ebd30abe403d402e813513cef675694.tar.gz jquery-d0e8a2452ebd30abe403d402e813513cef675694.zip |
Fixed a bug in the jQuery.prop() addition and fixed the test cases to represent the current set of features.
Diffstat (limited to 'src')
-rw-r--r-- | src/jquery/coreTest.js | 10 | ||||
-rw-r--r-- | src/jquery/jquery.js | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 4b29c8f86..73621cd17 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -67,13 +67,9 @@ test("attr(String)", function() { ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );
});
-test("attr(String, Function|String)", function() {
+test("attr(String, Function)", function() {
+ expect(1);
ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );
- ok( $('#text2').attr('value', "${this.id}")[0].value == "text2", "Set value from id" );
- reset();
- $('#text1, #text2').attr({value: "${this.id + 'foobar'}"});
- ok( $('#text1')[0].value == "text1foobar", "Set value from id" );
- ok( $('#text2')[0].value == "text2foobar", "Set value from id" );
});
test("attr(Hash)", function() {
@@ -440,4 +436,4 @@ test("removeAttr(String", function() { test("text(String, Boolean)", function() {
ok( $("#foo").text("<div><b>Hello</b> cruel world!</div>")[0].innerHTML == "<div><b>Hello</b> cruel world!</div>", "Check escaped text" );
ok( $("#foo").text("<div><b>Hello</b> cruel world!</div>", true)[0].innerHTML == "Hello cruel world!", "Check stripped text" );
-});
\ No newline at end of file +});
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 50549bb14..4f1306aeb 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1235,7 +1235,7 @@ jQuery.extend({ prop: function(elem, key, value){ // Handle executable functions return value.constructor == Function && - value.call( elem, val ) || value; + value.call( elem ) || value; }, className: { |