Skip to main content

Bug Tracker

Side navigation

#1261 closed bug (duplicate)

Opened June 01, 2007 01:52PM UTC

Closed June 21, 2007 07:33PM UTC

jQuery 1.1.2 causes JS error with nested id selectors of non-existent elements

Reported by: jazer Owned by:
Priority: major Milestone: 1.1.3
Component: core Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:

A nested id selector, e.g. $("#foo #bar") will cause an error when used in a document that does not contain the targeted element.

The error (as reported by Firebug) is "ret[ret.length - 1] has no properties".

Here's the entire error output:

ret[ret.length - 1] has no properties

find("#bar", Document u.html) jquery-latest.js (line 968)

find(Document u.html) jquery-latest.js (line 186)

map([Document u.html], function()) jquery-latest.js (line 636)

find("#foo #bar") jquery-latest.js (line 185)

jQuery("#foo #bar", undefined) jquery-latest.js (line 38)

jQuery("#foo #bar", undefined) jquery-latest.js (line 19)

(no name)() u.html (line 18)

to the wait list jQuery.readyList.push() jquery-latest.js (line 1430)

(no name)() jquery-latest.js (line 1455)

each([function()], function(), undefined) jquery-latest.js (line 312)

ready() jquery-latest.js (line 1454)

[Break on this error] if ( m[1] == "#" && ret[ret.length-1].getElementById ) {

Attachments (0)
Change History (1)

Changed June 21, 2007 07:33PM UTC by brandon comment:1

resolution: → duplicate
status: newclosed

Duplicate of #895