[jQuery] Change/Break in the JQuery 1.3 selecting xml nodes based on attribute value?
Hi There,
I have been trying to integrate JQuery 1.3 into our software but found
it breaking where I have previously successfully been using JQuery
1.2.6 to select xml nodes.
The following test page illustrates and explains the problem. To
recreate the issue you would need to create a html file containing all
of the following as well as an xml file named XMLFile.xml which
returns the xml noted in the comments below as well as a copy of both
JQuery 1.2.6 and 1.3 as named/referenced in the head below.
Does anybody know whether this might be a bug, intended behaviour
(these selectors still seem to be supported although I noted the @
symbol should now be removed from the attribute name which I have
done) or something I need to change in my code for the latest JQuery
version?
Thanks,
Chris
TEST PAGE
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--<script src="jquery_1.2.6.js" type="text/javascript"></
script>-->
<script src="jquery_1.3.js" type="text/javascript"></script>
</head>
<body>
Running this page with jquery 1.2.correctly performs the selection,
1.3 fails as noted below:
<script type="text/javascript">
function successXml(data) {
/* With JQuery 1.3 the following falls over. IE shows
---------------------------
Windows Internet Explorer
---------------------------
Stop running this script?
A script on this page is causing Internet Explorer to run
slowly.
If it continues to run, your computer may become
unresponsive.
---------------------------
Yes No
---------------------------
And the VS.NET 2008 debugger then says:
Microsoft JScript runtime error: Object doesn't support this
property or method
*/
var res = $("result[name='MyResultNode']", data);
alert(res[0].xml);
};
/* NOTE XML Page returns:
<result name="MyResultNode">
<object name="MyObjectNode">
<group name="MyGroupNode">
<value name="Head" mode="enabled"/>
</group>
</object>
</result>
/*
$.ajax({
url: "XMLFile.xml",
dataType: "xml",
success: successXml
});
</script>
</body>
</html>