Connecting Tech Pros Worldwide Help | Site Map

how to access responseText or ResposeXML without status=200

  #1  
Old November 18th, 2006, 10:45 AM
Yash
Guest
 
Posts: n/a
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:

  #2  
Old November 18th, 2006, 10:55 AM
Randy Webb
Guest
 
Posts: n/a

re: how to access responseText or ResposeXML without status=200


Yash said the following on 11/18/2006 6:02 AM:
Quote:
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/
  #3  
Old November 18th, 2006, 12:15 PM
Daz
Guest
 
Posts: n/a

re: how to access responseText or ResposeXML without status=200



Randy Webb wrote:
Quote:
Yash said the following on 11/18/2006 6:02 AM:
Quote:
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! :)

  #4  
Old November 18th, 2006, 12:35 PM
Yash
Guest
 
Posts: n/a

re: how to access responseText or ResposeXML without status=200


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:
Quote:
Yash said the following on 11/18/2006 6:02 AM:
Quote:
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/
  #5  
Old November 18th, 2006, 12:35 PM
Yash
Guest
 
Posts: n/a

re: how to access responseText or ResposeXML without status=200


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:
Quote:
Yash said the following on 11/18/2006 6:02 AM:
Quote:
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/
  #6  
Old November 18th, 2006, 01:15 PM
Yash
Guest
 
Posts: n/a

re: how to access responseText or ResposeXML without status=200



really my req.responseXML is giving null

Randy Webb wrote:
Quote:
Yash said the following on 11/18/2006 6:02 AM:
Quote:
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/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
why do we get this error This XML file does not appear to have any style information quayum answers 1 November 20th, 2006 09:36 AM