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
> [email protected]
> http://jquery.com/discuss/
>
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/