•
•
•
•
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 401,622 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,745 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
Views: 4573 | Replies: 24 | Solved
![]() |
•
•
•
•
Problem is when i run this code in IE it works fine.It takes the second try method in the index.jsp
When it comes to mozilla it throws an exception from the first try method as "Please use a new browser! This browser does not support XML!"
so can u help me please
Do you have firebug installed on Firefox?
Try viewing your XMLHttpRequest in Firebug and seeing if the response is well formatted.
What version of FF is it btw?
You can also tell if its well formatted or not by testing for the existence of xmlHttp.responseXML.
You should really be using xmlHttp.responseXML anyway, since any browser supporting XMLHttpRequest will support the responseXML property.
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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Try removing the different DOM parsing functions and just have XMLHttpRequest return XML.
function ajax()
{
var name=document.getElementById('name').value;
getXmlHttp();
var myurl="<%=request.getContextPath()%>/AjaxController?type=ajax&name="+name;
alert(myurl);
xmlHttp.open("GET", myurl , true);
xmlHttp.onreadystatechange = useHttpResponseSuggestId;
xmlHttp.send(null);
}
function useHttpResponseSuggestId()
{
if (xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
var textout = xmlHttp.responseText;
alert(textout);
var xmlObj = xmlHttp.responseXml.documentElement;
var master = document.getElementById('ajaxname');
master.value=xmlObj.childNodes[0].firstChild.nodeValue;
}
}
} 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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
function useHttpResponseSuggestId()
{
if (xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
var textout = xmlHttp.responseText;
alert(textout);
try
{
var xmlObj = xmlHttp.responseXml.documentElement;
var master = document.getElementById('ajaxname');
master.value=xmlObj.childNodes[0].firstChild.nodeValue;
alert(master.value);
}
catch(e)
{
try
{
alert("hi1234");
var xmldom = new ActiveXObject('Microsoft.XMLDOM');
xmldom.async="false";
xmldom.loadXML(textout);
xmlObj=xmldom.documentElement;
var master = document.getElementById('ajaxname');
master.value = xmlObj.childNodes[0].firstChild.nodeValue;
}
catch(e)
{
alert("Please use a new browser! This browser does not support XML!");
}
}
}
}
}after your suggestion i tried this code buy it doesnt work with mozilla again ?
I misspelled responseXML. It should be
var xmlObj = xmlHttp.responseXML.documentElement;
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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
It again doesn't work ?
i put this alert message.when explorer it displays [Object] and in Mozilla it displays [Object element]
after this code i put
then this alert is not working i think this makes an exception ?
var xmlObj = xmlHttp.responseXML.documentElement;
alert(xmlObj);i put this alert message.when explorer it displays [Object] and in Mozilla it displays [Object element]
after this code i put
master.value=xmlObj.childNodes[0].firstChild.nodeValue;
alert(master.value); then this alert is not working i think this makes an exception ?
Last edited by sree22_happy : Jan 24th, 2008 at 10:39 pm.
•
•
•
•
It again doesn't work ?
var xmlObj = xmlHttp.responseXML.documentElement; alert(xmlObj);
i put this alert message.when explorer it displays [Object] and in Mozilla it displays [Object element]
after this code i put
master.value=xmlObj.childNodes[0].firstChild.nodeValue; alert(master.value);
then this alert is not working i think this makes an exception ?
Yes, the exception occurs at
master.value=xmlObj.childNodes[0].firstChild.nodeValue;
it seems.
In your catch block place an
alert(e);
So we can see what the exception is.
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!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp beta bon browser browsers cross-browser javascript menu with few lines of code developer development echo email encryption europe firefox gecko home html internet internet explorer javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator leak linux memory microsoft mozilla msdn news nintendo office open source opera patch privacy scams security site software spoof sql testing thunderbird url users vista web webmail wii windows
- Problem in Ajax (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Change function in bottom
- Next Thread: two scripts beat as one


Linear Mode