[jQuery] Multiple XML selector error in IE6 introduced in 1.3.2?
Hi
I'm getting an error in IE6 using jQuery 1.3.2 that was not present in
1.3.1. The HTML file is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IE6 problem selector</title>
<script src="stores/jquery 1.3.2.js" type="text/javascript"></script>
<script>
$(document).ready(function() { // Set up DOM-ready functions
if ($.browser.msie) doc = new ActiveXObject("microsoft.xmldom");
else doc = document.implementation.createDocument("", "", null);
doc.async = false;
doc.load("test2.xml");
root = doc.documentElement;
if (root) {
alert($("a", root).length);
alert($("b", root).length);
alert($("a, b", root).length);
}
});
</script>
</head>
<body>
</body>
</html>
and the XML referenced is
<?xml version="1.0" encoding="UTF-8"?>
<root>
<a/>
<b/>
<b/>
</root>
In Firefox 3 this produces alerts of 1, 2 and 3 as expected. This also
happens in IE6 using jQuery 1.3.1, but in 1.3.2 the first two alerts
are produced but then an error is generate on the 3rd:
Line 16, char 5, 'length' is null or not an object
(Line 16 is the multiple selector.)
The error occurs whenever there are two or more occurrences of the b-
node; it doesn't seem to matter how many a-nodes there are.
Alan