Bug Tracker

Modify

Ticket #3167 (closed bug: fixed)

Opened 5 years ago

Last modified 3 years ago

z.indexOf is not a function

Reported by: hkirsman Owned by: flesler
Priority: minor Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: select input Cc: hkirsman
Blocking: Blocked by:

Description

PROBLEM a specific jquery select and form with name=name gives "z.indexOf is not a function" error

CURRENT WORKAROUND - add form in front of the query

Attachments

bug.html Download (512 bytes) - added by hkirsman 5 years ago.
bug with selection of 'input type=text name=name '
jqselecttest.html Download (564 bytes) - added by vlad 5 years ago.
Demo of selector failing on an unrelated to the selection elements

Change History

Changed 5 years ago by hkirsman

bug with selection of 'input type=text name=name '

comment:1 Changed 5 years ago by Markus.Staab

the input field in your testcase should have the name "blah", not name.

comment:2 Changed 5 years ago by flesler

  • need changed from Patch to Test Case
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from core to selector

Right, I'll close for now.

Reopen this if you modify the test case and it still fails.

comment:3 Changed 5 years ago by vlad

  • Status changed from closed to reopened
  • Resolution invalid deleted

Guys, thank you for the awesome library!

This specific bug hits me big time and as I deal with the code form other developers, which I have limited access to, it makes it worse.

See the attached bug file - it works without the form, while failing with the form. The query has nothing to do with the form! In my case, the form is someone else's code!

The way to debug the problem is the following (my page is huge, so can not do it by breakpoints):

In jquery-1.2.6.js, after the following text at lines 1709 - 1711:

  if ( z == null || /href|src|selected/.test(m[2]) )
    z = jQuery.attr(a,m[2]) || '';

Insert the debug catcher:

  if (z !== z.toString()) {
    $(z).addClass('bug3167');
    z = z.toString();
  }

Then, in the FireFox console, look for the elements $('.bug3167')

By the way, just brutally adding the line

  z = z.toString();

, instead of the debug catcher after line 1711, saves it from aborting on 1717 (now 1718). Now, I think it is OK in my environment, but getting a proper fix would make me much more willing to release the code to production.

Changed 5 years ago by vlad

Demo of selector failing on an unrelated to the selection elements

comment:4 Changed 5 years ago by flesler

  • Cc hkirsman, flesler added
  • Owner set to flesler
  • Status changed from reopened to new

Yes, I think I saw this on another ticket. I pulled out the perfect solution, but it hits perfomance. Will handle this once I get a while.

comment:5 Changed 5 years ago by flesler

  • Cc flesler removed
  • Status changed from new to assigned

comment:6 Changed 4 years ago by vlad

I have mentioned this bug in the 1.3b1 bug #3753. Both bugs work off of the same test case but address different problems.

comment:8 Changed 3 years ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to fixed

Test case does not throw an error with 1.3 or 1.4.

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.