#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 13 years ago by
comment:3 Changed 12 years ago by
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
Owner: | set to hallettj |
---|---|
Status: | new → pending |
See previous question.
comment:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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
That's because the href attribute is removed when you use the behavior.
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 anexpires
attribute. So that attribute could be used in a check inExpr.attrHandle.href()
. Though I don't know of any way to get an unmodifiedhref
value from an attribute after it has userData enabled.