Bug Tracker

Modify

Ticket #6164 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

issue with index method (DOM Element Method)

Reported by: chrismo111 Owned by:
Priority: undecided Milestone: 1.4.2
Component: misc Version: 1.4.1
Keywords: index, DOM Element Methods Cc:
Blocking: Blocked by:

Description

Problem with .index method (Miscellaneous > DOM Element Methods),  http://api.jquery.com/index/

Here's a scenario that worked in 1.3.2 but does not in version 1.4.2:

var fruits=["apple","orange","pear"]; var i = $(fruits).index("pear"); alert(i);

In version 1.3.2 the value of i is 2. In version 1.4.2 the value is -1

a non jquery alternative is indexOf BUT IE6 doesn't support it

Change History

comment:1 Changed 3 years ago by dmethvin

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to invalid

I don't think we support wrapping an array of strings in a jQuery object and then applying jQuery methods on that. It may have worked in the past by chance.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.