[jQuery] Re: How to get the responsetext with $.ajax

2009-12-10 Thread Satyakaran
var reponse = xhr.responseText; should not work inside $.ajax () as
xhr is assigned after the call.

On Dec 9, 6:55 pm, ftw unrecev...@live.fr wrote:
 hi,
 I'am using jquery to get a response from a php page, here it is :

 function verif(thediv)
         {
                 var xhr = $.ajax({
                         type: POST,
                         url: some.php,
                         data: name=some variable,
                         success: function(msg){

                         var reponse = xhr.responseText;
                         alert(here :  +reponse);

                         }
                 });

         }

 I tried many things there is no way to get the responseText (that should be
 yes or no), i want absolutly to use a asynchrone methode (the method with
 the async : false, don't helpe me at all :wistle: )

 Thank you for any help :handshake:
 --
 View this message in 
 context:http://old.nabble.com/How-to-get-the-responsetext-with-%24.ajax-tp267...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: How to get the responsetext with $.ajax

2009-12-09 Thread Civette
I do have something h looking like your code taht works fine.

I do return result in a div :

___

$.ajax({
type: POST,
url: get_opened_all.php,
data: 
from_date=+$('input#from_date').val()+to_date=+$
('input#to_date').val()+who=+$('#who').val(),
async: false,
success: function(data){
  $(#opened_all).empty().append(data);
}
});



On Dec 9, 2:55 pm, ftw unrecev...@live.fr wrote:
 hi,
 I'am using jquery to get a response from a php page, here it is :

 function verif(thediv)
         {
                 var xhr = $.ajax({
                         type: POST,
                         url: some.php,
                         data: name=some variable,
                         success: function(msg){

                         var reponse = xhr.responseText;
                         alert(here :  +reponse);

                         }
                 });

         }

 I tried many things there is no way to get the responseText (that should be
 yes or no), i want absolutly to use a asynchrone methode (the method with
 the async : false, don't helpe me at all :wistle: )

 Thank you for any help :handshake:
 --
 View this message in 
 context:http://old.nabble.com/How-to-get-the-responsetext-with-%24.ajax-tp267...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: How to get the responsetext with $.ajax

2009-12-09 Thread MorningZ
is yes or no what you are returning from some.php?  if that's
the case, variable msg is what contains that

On Dec 9, 8:55 am, ftw unrecev...@live.fr wrote:
 hi,
 I'am using jquery to get a response from a php page, here it is :

 function verif(thediv)
         {
                 var xhr = $.ajax({
                         type: POST,
                         url: some.php,
                         data: name=some variable,
                         success: function(msg){

                         var reponse = xhr.responseText;
                         alert(here :  +reponse);

                         }
                 });

         }

 I tried many things there is no way to get the responseText (that should be
 yes or no), i want absolutly to use a asynchrone methode (the method with
 the async : false, don't helpe me at all :wistle: )

 Thank you for any help :handshake:
 --
 View this message in 
 context:http://old.nabble.com/How-to-get-the-responsetext-with-%24.ajax-tp267...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: How to get the responsetext with $.ajax

2009-12-09 Thread MorningZ
Use Firebug's XHR tab and you'll see exactly what some.php responds
with and then you can code accordingly  as of now, what you are
trying to accomplish and what you think is going on are total
guesses  Firebug will help pinpoint what is happening

On Dec 9, 9:25 am, ftw unrecev...@live.fr wrote:
 ftw wrote:

  is yes or no what you are returning from some.php?  if that's
  the case, variable msg is what contains that

 ok, i used what you said (msg varaiable) like this :

 function verif(thediv)
         {
                 var xhr = $.ajax({
                         type: POST,
                         url: some.php,
                         data: name=some,

                         success: function(msg)
                          {
                            alert(msg);
                          }

                 });

 unfortunatly the alert gives me this response: Object XMLHTTPrequest, my pag
 some.php should aswer yes or no. Have i any mistake ?:-/

 nb: the link you gave it me doesn' work. error 404
 thanks for help :-)

 --
 View this message in 
 context:http://old.nabble.com/How-to-get-the-responsetext-with-%24.ajax-tp267...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.