473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to access responseText or ResposeXML without status=200

Hi friends,
I am using AJAx to call a method on the server which sends a mail to
the user.

my code if(status == 200) is evaluating to false yet the mail is
delivered.
But because of the above status I am un able to display the message to
the user.
Do any one hava an idea how to access responseText or ResposeXML
without status=200
because my prime target is to display messages in the user interface.
thanks:

Nov 18 '06 #1
5 2944
Yash said the following on 11/18/2006 6:02 AM:
Hi friends,
I am using AJAx to call a method on the server which sends a mail to
the user.

my code if(status == 200) is evaluating to false yet the mail is
delivered.
But because of the above status I am un able to display the message to
the user.
Do any one hava an idea how to access responseText or ResposeXML
without status=200
because my prime target is to display messages in the user interface.
thanks:
Have your mail script return text to the browser in addition to having
it send the email.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 18 '06 #2
Daz

Randy Webb wrote:
Yash said the following on 11/18/2006 6:02 AM:
Hi friends,
I am using AJAx to call a method on the server which sends a mail to
the user.

my code if(status == 200) is evaluating to false yet the mail is
delivered.
But because of the above status I am un able to display the message to
the user.
Do any one hava an idea how to access responseText or ResposeXML
without status=200
because my prime target is to display messages in the user interface.
thanks:

Have your mail script return text to the browser in addition to having
it send the email.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Ah, the simplicity! :)

Nov 18 '06 #3
Hi,
thanks for reply,
I am returning action messages from my class, these action messages
need to be displayed in the user intrface. I am using spanElements and
replaceExistingElements to show these messages.
The problem is that the "req.status" is not becoming 200 in the
following code:

if (status == "ok" || status == "OK" || status == 200) { // OK response
reached now we can process the response
//Split the text response into Span elements
spanElements =
splitTextIntoSpan(req.responseText);
//Use these span elements to update the page
replaceExistingWithNewHtml(spanElements);
}
else {
alert("Problem with browser response:\n Response status "
+ req.statusText);
}

so, I am getting the alert even when the email is actually send.

any suggestions are welcome.

Randy Webb wrote:
Yash said the following on 11/18/2006 6:02 AM:
Hi friends,
I am using AJAx to call a method on the server which sends a mail to
the user.

my code if(status == 200) is evaluating to false yet the mail is
delivered.
But because of the above status I am un able to display the message to
the user.
Do any one hava an idea how to access responseText or ResposeXML
without status=200
because my prime target is to display messages in the user interface.
thanks:

Have your mail script return text to the browser in addition to having
it send the email.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 18 '06 #4
One more thing,
the same ajax code is working for some other purpose, which in turn is
returning oonly messages (action messages). that class is not even
setting the ContentType to "text/xml", it is simply returning action
messages after some database checking.
Randy Webb wrote:
Yash said the following on 11/18/2006 6:02 AM:
Hi friends,
I am using AJAx to call a method on the server which sends a mail to
the user.

my code if(status == 200) is evaluating to false yet the mail is
delivered.
But because of the above status I am un able to display the message to
the user.
Do any one hava an idea how to access responseText or ResposeXML
without status=200
because my prime target is to display messages in the user interface.
thanks:

Have your mail script return text to the browser in addition to having
it send the email.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 18 '06 #5

really my req.responseXML is giving null

Randy Webb wrote:
Yash said the following on 11/18/2006 6:02 AM:
Hi friends,
I am using AJAx to call a method on the server which sends a mail to
the user.

my code if(status == 200) is evaluating to false yet the mail is
delivered.
But because of the above status I am un able to display the message to
the user.
Do any one hava an idea how to access responseText or ResposeXML
without status=200
because my prime target is to display messages in the user interface.
thanks:

Have your mail script return text to the browser in addition to having
it send the email.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
4
by: Robert Fish | last post by:
The compacting routine just hangs after about 20 seconds. Any suggestions? -- Robert Fish ------------------------------------------------------------------------ Robert Fish's Profile:...
1
by: Barry | last post by:
I have inherited an Access 2000 database that when you enter certain parameters it creates a Pivot Table of the results. This works fine with Access Runtime or Access XP but it will not work on...
2
by: HSD | last post by:
database not allowing multiusers -------------------------------------------------------------------------------- Background An ACCESS database containing two tables and three forms has been...
3
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
1
by: shiniskumar | last post by:
i go tto perform some validation while ck=liking a button without refreshing the value.. i used ajax.My code is as follows...on button click i call the function validateGridAdd(); Inside tat...
3
by: JMcCrillis | last post by:
I've implemented a FileUpload servlet using AJAX and JS. It appears to be working well but for one issue. I used XMLHTTP so I could intercept the response in Javascript and write it out to a field...
1
by: gihan | last post by:
Hi, I have a problem accessing remote webservice from my asp code. Instead of returning results, it returns list of web methods it has. Wonder where i'm doing wrong. Also note that, this is a...
1
by: par7133 | last post by:
Hi, Yea, XMLHttpRequest give out a crossbrowser problem managing the status change of the connection. Here the solution: var xmlhttp; xmlhttp=null;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.