Consider the following snippet of code:
function parseXml(xml)
{
xmlObject= xml;
alert(xmlObject.xml);
}
function close(errroMsg)
{
//Displayed Error Message
}
$(document).ready(function()
{
$.ajax(
{
type: "POST",
url: "ServiceProvider.aspx",
dataType: "xml",
success: parseXml,
failure: close
}
);
});
In IE-8 the alert(xmlObject.xml) disaplays xml string.
but in Mozilla it displays undefined.
I am using jquery-1.4.2
I was unable to figure out the error.
Thanks in Advance.
IE has a slightly different implementation of XML documents from other browsers, one of the differences being that in IE there is an
xmlproperty of the document.If you want to serialize the XML into a string in all browsers, you can use the following: