Jake,

Thanks for the help. I changed my code to look like this and got things 
to work.

         $('#rgeo').bind('submit', function(){
             var xml = $.ajax({
                 url: "/rgeo/",
                 dataType: "xml",
                 async: false,
                 data: {
                     x: document.rgeo.x.value,
                     y: document.rgeo.y.value
                 }
             }).responseText;
             $("#response")[0].value = xml;
             return false;
         });

This should be better documented in the $.ajax() documentation.

Thanks,
-Steve

Ⓙⓐⓚⓔ wrote:
> you're close... you don't get simple text from an xml request.
> 
> you get a big ol' request object.
> 
> if you just want the text from the html
> 
> you can see it in a 'complete' call back with data.responseText
> 
> inside success, you get back the responseXML part of the request.
> it's an xmlDocument  that needs to be navigated with $("answer",data)
> or something like that!
> 
> Hope that helps!
> 
> 
> On 2/13/07, Stephen Woodbridge <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> How do I get the XML response of an ajax request? I want to put the XML
>> text into a textarea and can do find this documented.
>>
>>              $.get("/rgeo/",
>>                  { x: document.rgeo.x.value, y: document.rgeo.y.value },
>>                  function(data){
>>                      console.log(data);
>>                      $("textarea#response")[0].value = data;
>>                  }
>>              );
>>
>>
>>
>> My textarea ends up with the string "[object XMLDocument]"
>>
>> I also tried:
>>
>>
>>              $.ajax({
>>                  url: "/rgeo/",
>>                  dataType: "xml",
>>                  data: {
>>                      x: document.rgeo.x.value,
>>                      y: document.rgeo.y.value
>>                  },
>>                  success: function(data){
>>                      console.log(data);
>>                      $("textarea#response")[0].value = data;
>>                  }
>>              });
>>
>> Thanks,
>>    -Steve
>>
>> _______________________________________________
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
> 
> 


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to