Modify ↓
Ticket #12130 (closed bug: duplicate)
jQuery.each on object with length element.
| Reported by: | jakecigar@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I think jQuery.each should check for length to be present and an integer, rather than just checking for it’s existance.
The innocent Object { "length":"33", "text":"foo" } can’t be used with $.each.
Change History
comment:2 Changed 10 months ago by dmethvin
- Status changed from new to closed
- Resolution set to duplicate
comment:4 Changed 10 months ago by dmethvin
Honestly, I think doing this would just confuse things more.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

It came up on the forum http://forum.jquery.com/topic/parsejson-gotcha-with-reserved-words#14737000003512366