Skip to main content

Bug Tracker

Side navigation

#1471 closed bug (wontfix)

Opened August 06, 2007 08:54PM UTC

Closed August 09, 2007 11:20PM UTC

Last modified August 16, 2007 04:38PM UTC

filter() should accept the same arguments as not()

Reported by: joern Owned by:
Priority: minor Milestone: 1.1.4
Component: core Version: 1.1.3
Keywords: Cc:
Blocked by: Blocking:
Description

Assuming that the variable selector in the following example can be a selector string and a DOM element or jQuery object:

headers.not(headers.not(selector))

This should be the same as:

headers.filter(selector)

but filter accepts only callbacks and strings.

Attachments (0)
Change History (2)

Changed August 09, 2007 11:20PM UTC by john comment:1

resolution: → wontfix
status: newclosed

Why? What would be the purpose of passing in either one of those? In both cases it would just reduce the jQuery object to nothing but what you passed in - effectively making it the same as $(element || object).

Changed August 16, 2007 04:38PM UTC by joern comment:2

An example:

headers = $("div.header");

// some client code passing in the selector
selector = ":eq(0)"
// works, because filter accepts strings
headers.filter(selector) 

// same client code, but passes in an dom element
selector = document;
// doesn't work
headers.filter(document)
// works
headers.not(headers.not(selector))