Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#6590 closed bug (invalid)

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.

Change History (6)

comment:1 Changed 10 years ago by hallettj

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.

comment:2 Changed 9 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:3 Changed 9 years ago by snover

Priority: undecided

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

comment:4 Changed 9 years ago by snover

Owner: set to hallettj
Status: newpending

See previous question.

comment:5 Changed 9 years ago by trac-o-bot

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!

comment:6 Changed 7 years ago by anonymous

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

Note: See TracTickets for help on using tickets.