Skip to main content

Bug Tracker

Side navigation

#194 closed bug (fixed)

Opened September 09, 2006 08:13PM UTC

Closed September 16, 2006 02:59PM UTC

Last modified June 20, 2007 05:23AM UTC

Fix for attribute *=, ^=, and $= in cases where special attributes.

Reported by: bjmiller@bway.net Owned by:
Priority: major Milestone: 1.0
Component: core Version: 1.0
Keywords: attribute Cc:
Blocked by: Blocking:
Description

In FF 1.5, selecting attribute @name where the name attribute is not present results in a "z has no properties" error, because z, which should be "" when the attribute is not present, has a value of null.

Attachments (0)
Change History (3)

Changed September 09, 2006 08:39PM UTC by anonymous comment:1

This has solved the problem:

Change jQuery.expr."@" from

"@": {
	"=": "z==m[4]",
	"!=": "z!=m[4]",
	"^=": "!z.indexOf(m[4])",
	"$=": "z.substr(z.length - m[4].length,m[4].length)==m[4]",
	"*=": "z.indexOf(m[4])>=0",
	"": "z"
},

to

"@": {
	"=": "z==m[4]",
	"!=": "z!=m[4]",
	"^=": "z && !z.indexOf(m[4])",
	"$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]",
	"*=": "z && z.indexOf(m[4])>=0",
	"": "z"
},

We're just testing for null before we try to call the indexOf() or substr() methods that we expect from strings.

Changed September 12, 2006 04:40PM UTC by bjmiller@bwa comment:2

milestone: → 1.0
version: → 1.0

Changed September 16, 2006 02:59PM UTC by joern comment:3

resolution: → fixed
status: newclosed

Fixed in SVN.