Skip to content
Permalink
Browse files

Fixed a bug in the jQuery.prop() addition and fixed the test cases to…

… represent the current set of features.
  • Loading branch information
jeresig committed Jan 8, 2007
1 parent b603ca0 commit d0e8a2452ebd30abe403d402e813513cef675694
Showing with 4 additions and 8 deletions.
  1. +3 −7 src/jquery/coreTest.js
  2. +1 −1 src/jquery/jquery.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 == "&lt;div&gt;&lt;b&gt;Hello&lt;/b&gt; cruel world!&lt;/div&gt;", "Check escaped text" );
ok( $("#foo").text("<div><b>Hello</b> cruel world!</div>", true)[0].innerHTML == "Hello cruel world!", "Check stripped text" );
});
});
@@ -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: {

0 comments on commit d0e8a24

Please sign in to comment.
You can’t perform that action at this time.