Ticket #7818 (closed bug: fixed)
META: Define validity of plain JS objects for jQuery() and its methods
|Reported by:||dmethvin||Owned by:|
Description (last modified by ajpiano) (diff)
In the past a jQuery collection has mainly been DOM elements, with document or window allowed in some cases. We are starting to encourage wrapping plain JS objects in jQuery for purposes like pub/sub, and also seeing tickets like #7500 where people expect to use .attr() on plain JS objects.
We need to document the extent to which we support JS objects and decide the behavior of methods that don't accept JS objects. For example, $(obj).removeAttr("x") when used on a JS object currently sets the property to an empty string, it seems like the correct semantic action is to delete obj.x instead. BUT ... is it worth taking the size/performance/complexity hit to orthogonally handle something that is relatively rare?
PS, How does .data() differ from attr() on a plain object?
PPS, TEST CASES.
- Priority changed from undecided to blocker
- Status changed from new to open
- Component changed from unfiled to core
- Milestone changed from 1.next to 1.5
comment:21 Changed 4 years ago by rwaldron
- Keywords needsdocs added; 1.7-discuss removed
- Priority changed from blocker to low
- Milestone changed from 1.next to 1.6.1
comment:25 Changed 4 years ago by timmywil
- Status changed from open to closed
- Resolution set to fixed