[jQuery] Problem with IE (Ajax + XML fragments)
I am sure, this question has been asked before, but I cannot find it in this mailing list. Therefore I will have to ask again.
I am having a very simple example working on Firefox, but on IE 6 it does not work. I am loading an XML document via Ajax and try to append a fragment of this document to my HTML.
This is my HTML:
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<script type="text/javascript" src="scripts/jquery-1.1.1.js"></script>
<script type="text/javascript">
//<[!CDATA[
$(document).ready(function() {
$(document).ajaxError(function(request, settings){
alert("Error " + settings.status + ": " + settings.statusText + " [" + request.target.URL + "]");
});
$.get("test.xml", function(xml) {
var content = $("bar", xml).children();
$(".test").each(function() {
$(this).append(content);
});
});
});
//]]>
</script>
</head>
<body>
<div class="test" />
</body>
</html>
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<foo>
<bar><span>Test</span></bar>
</foo>
Expected Result: The <div> element should be append by a <span>Test</span> element.
Firefox: OK
IE 6: not OK (the Ajax request will return an error). The error is produced in the .append command.
Please help me!
Thanks,
Harald
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/