Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 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:


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.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 13 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 12 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:3 Changed 12 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 12 years ago by snover

Owner: set to hallettj
Status: newpending

See previous question.

comment:5 Changed 12 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 11 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.