Skip to main content

Bug Tracker

Side navigation

#820 closed bug (fixed)

Opened January 15, 2007 10:47PM UTC

Closed January 16, 2007 09:18AM UTC

Last modified June 19, 2007 09:25AM UTC

.attr(String, Function(i){}) could use the index

Reported by: Fil Owned by:
Priority: minor Milestone: 1.1
Component: core Version: 1.1
Keywords: attr Cc: fil@rezo.net
Blocked by: Blocking:
Description

Here's the patch to the testfile:

Index: src/jquery/coreTest.js
===================================================================
--- src/jquery/coreTest.js      (revision 1073)
+++ src/jquery/coreTest.js      (working copy)
@@ -82,8 +82,9 @@
 });
 
 test("attr(String, Function)", function() {
-       expect(1);
+       expect(2);
        ok( $('#text1').attr('value', function() { return this.id })[0].value == "text1", "Set value from id" );
+       ok( $('#text1').attr('title', function(i) { return i }).attr('title') == 1, "Set value with an index");
 });
 
 test("attr(Hash)", function() {

but alas i is undefined

Attachments (1)
Change History (3)

Changed January 16, 2007 09:04AM UTC by Fil comment:1

After reading the documentation, this should be filed under "enhancement", not "bug".

Changed January 16, 2007 09:18AM UTC by joern comment:2

resolution: → fixed
status: newclosed

Implemented in SVN, revision 1091.

Changed January 16, 2007 09:21AM UTC by joern comment:3