Skip to main content

Bug Tracker

Side navigation

#6590 closed bug (invalid)

Opened May 20, 2010 11:10PM UTC

Closed December 05, 2010 08:08AM UTC

Last modified July 22, 2012 08:30PM UTC

Error reading 'href' attribute in IE when userData Behavior is applied

Reported by: hallettj Owned by: hallettj
Priority: undecided Milestone:
Component: attributes Version: 1.4.2
Keywords: IE, IE6, IE7, userdata, behavior, href Cc:
Blocked by: Blocking:
Description

userData Behavior <http://msdn.microsoft.com/en-us/library/ms531424(VS.85).aspx> is a local storage implementation in IE.

jQuery calls getAttribute("href", 2) in IE to read the 'href' attribute of an element.

Apparently if userData Behavior is applied to an element and getAttribute() is later called on the same element with more than one argument the result is an error.

Steps to reproduce in IE7:

var a = $('<a href="#foo"/>');
a.get(0).addBehavior('#default#userData');
a.attr('href');  // Error: Wrong number of arguments or invalid property assignment

As far as I can tell this affects IE6 and IE7. I encountered this error when using jQuery in combination with persist.js.

Attachments (0)
Change History (6)

Changed May 20, 2010 11:46PM UTC by hallettj comment:1

Looking further into this I see that elements with userData enabled have an expires attribute with an - often empty - string value. Elements that do not have userData enabled generally do not have an expires attribute. So that attribute could be used in a check in Expr.attrHandle.href(). Though I don't know of any way to get an unmodified href value from an attribute after it has userData enabled.

Changed November 12, 2010 02:40AM UTC by snover comment:2

milestone: 1.4.3

Resetting milestone to future.

Changed November 17, 2010 05:00AM UTC by snover comment:3

priority: → undecided

So what happens to the href value? It becomes impossible to get the non-normalized value?

Changed November 21, 2010 02:24AM UTC by snover comment:4

owner: → hallettj
status: newpending

See previous question.

Changed December 05, 2010 08:08AM UTC by trac-o-bot comment:5

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed July 22, 2012 08:30PM UTC by anonymous comment:6

That's because the href attribute is removed when you use the behavior.