#7583 closed bug (invalid)
strange xml attribute with IE8
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | unfiled | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
i use a textarea for build xml and after i parse it with $() but in IE8 i have a strange result if i try to add a attribute on a node with another attribute, if the node have no attribute the result is ok. Use my script for test it, before change the javascript source.
the result: <LIST name="toto" label="Les menus"></LIST name="toto">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="./lib/js/jquery-1.4.4.min.js"></script> <title>Insert title here</title> </head> <body> <textarea id="xml"><list label="Les menus" ></list></textarea> <script type="text/javascript" > var text = $('#xml').text(); var xml = $(text); xml.attr('name', 'toto'); var root = $('<root></root>'); root.append(xml); alert(root.html()); </script> </body> </html>
Change History (2)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 12 years ago by
if this is the case then why does jquery pass back a jquery object of the xml received after an$.ajax operation?
i only ask as i'm experiencing a null exception moving from 1.4.3 to 1.4.4 whilst working with jquery/xml and was wondering whether to log a bug and test case
Note: See
TracTickets for help on using
tickets.
Thanks for the report, but this is not a jQuery bug. You cannot create arbitrary elements from strings in IE without a third-party compatibility library like innerShiv. Even if you use such a thing, you are likely to run into more issues, so generally speaking you simply should not try to use jQuery to operate on non-HTML documents. In the future, please use the jQuery Forum for support requests.