Rey Bango schrieb:
> So continuing on my learning experience, I initially tried using .ajax() 
> to make my Ajax call but was unsuccessful. Then with the help of John 
> and Arash, I was able to make the call via .get().
> 
> I'm revisiting the .ajax() issue since I'm not sure if its something 
> that I'm doing wrong or if its a bug in JQuery 1.0.1.
> 
> This code works:
> 
> $.get( "test.cfm", function(msg){
>                   alert( "Data Saved: " + $( "MyText", msg).text() );
>       });
> 
> This code does not:
> 
> $.ajax({ type: "GET",
>        url: "test.cfm",
>        dataType: "xml",
>        success: function(msg){ alert( $( "MyText", msg ).text() ); }
>                         });
> 
> For the .ajax snippet, Firebug returns the following XML as the response:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <MyRoot><MyText>FooManchu</MyText></MyRoot>
> 
> and the response header is:
> 
> Content-Type: text/xml
> 
> but the alert box specified in the success param comes out empty.
> 
> Any ideas?
> 
> Rey...


Do you use the very latest jquery from SVN? John fixed an issue 
yesterday where the success handler recieves the XHR object instead of 
the response body as its parameter.

To verify that you can try this:

success: function(msg){ alert( $( "MyText", jQuery.httpData(msg) 
).text() ); }

If in that case the desired value is returned, please switch back the 
code and update to the very latest SVN version.

I think the dataType property is obsolete... the xml should be handled 
correctly by jquery automatically.


-- Klaus



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

Reply via email to