Originally Posted by
sree22_happy
Actually the problem may be in this code
if(xmlHttp.status == 200)
{
var textout = xmlHttp.responseText;
try
{
var x= new DOMParser().parseFromString(textout, 'text/xml');
xmldom.async="false";
xmldom.loadXML(x);
alert(xmldom);
xmlObj=xmldom.documentElement;
var master = [document.getElementById('name'),document.getElementById('password'),
document.getElementById('realname'),document.getElementById('email'),
document.getElementById('title'),document.getElementById('desc')];
var length=xmlObj.childNodes.length;
for(var i=0;i<master.length;i++)
{
master[i].value = xmlObj.childNodes[i].firstChild.nodeValue;
}
}
I am getting the textout value as xml in IE but didnt get the values in Mozilla browser
Good Call.
You should use
var textout = xmlHttp.responseXML;
instead of
var textout = xmlHttp.responseText;
and remove the DOMParser() functions.
You have to either make sure your server sends the correct XML headers when serving the response.
eg in PHP:
header('Content-Type: text/xml');
OR you can force the browser to treat the response as XML.
xmlHttp.overrideMimeType('text/xml');
Then the XML document will be available for traversal/manipulation using DOM Interface.
Last edited by digital-ether : Jan 17th, 2008 at 6:45 am.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!