User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 373,932 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,218 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Problem with ajax and mozilla browser

Join Date: Sep 2005
Posts: 611
Reputation: digital-ether will become famous soon enough digital-ether will become famous soon enough 
Rep Power: 5
Solved Threads: 38
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Help Re: Problem with ajax and mozilla browser

  #5  
Jan 17th, 2008
Originally Posted by sree22_happy View Post
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!
Reply With Quote  
All times are GMT -4. The time now is 6:11 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC