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.
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.