Opened 13 years ago
Closed 12 years ago
#6692 closed enhancement (fixed)
.data(object) should extend the current settings not replace them.
Reported by: | ashays | Owned by: | |
---|---|---|---|
Priority: | Milestone: | 1.4.3 | |
Component: | data | Version: | 1.4.2 |
Keywords: | data | Cc: | |
Blocked by: | Blocking: |
Description
Unless there's some logical reason as to why this can't happen, I think it would be best if calling $(selector).data(object) would extend the current set of data. That is, if I were to say: var data = {a:1, b:2, d:3}; $("#id").data("a", "apple")
.data("b", "banana") .data("c", "codfish") .data(data) .data();
The return would be {a:1, b:2, c: "codfish", d:3};
Change History (2)
comment:1 Changed 13 years ago by
comment:2 Changed 12 years ago by
Milestone: | 1.5 → 1.4.3 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Agreed. That would also solve the problem of accidentally clobbering some other plugin's data -- unless you used the same name, of course.