Bug Tracker

Modify

Ticket #1446 (closed bug: invalid)

Opened 6 years ago

Last modified 6 years ago

init method doesn't check correctly form.elements property

Reported by: Andrea Giammarchi Owned by:
Priority: major Milestone: 1.2.1
Component: core Version: 1.2
Keywords: Cc:
Blocking: Blocked by:

Description

form.elements has different behaviour. While FireFox and Opera pass this check:

!form.elements.nodeType

where nodeType is undefined, Internet Explorer 6 (I don't know about 7) returns nodeType === 1 so I've temporary fixed return value inside init method using this check:

return this.setArray(
	a.constructor == Array && a ||
	(a.jquery || a.length && a != window && (!a.nodeType || a.length) && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
	[ a ]
);

Change History

comment:1 Changed 6 years ago by Andrea Giamm

fix proposal breaks other "queries". I suppose this is an IE <= 6 bug and not a jQuery problem. In IE form.elements === form and form.elements.elements.elements is === form again. Every property/method is the same because it's a form referer (wow ... )

Use $.each(form.elements, callback) to solve this strange behaviour (so I suppose this ticket should be closed)

comment:2 Changed 6 years ago by john

  • Status changed from new to closed
  • Version changed from 1.1.3 to 1.2
  • Resolution set to invalid
  • Milestone changed from 1.1.4 to 1.2.1

Closed at the request of poster.

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.