Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#7583 closed bug (invalid)

strange xml attribute with IE8

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by snover)

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">
<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>
<textarea id="xml">&lt;list label="Les menus" &gt;&lt;/list&gt;</textarea>
<script type="text/javascript" >
	var text = $('#xml').text();
	var xml = $(text);
	xml.attr('name', 'toto');
	var root = $('<root></root>');

Change History (2)

comment:1 Changed 12 years ago by snover

Description: modified (diff)
Resolution: invalid
Status: newclosed

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.

comment:2 Changed 12 years ago by [email protected]

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.