Hi John,

I changed the code to use $.get and I get the same result :o(

FireBug reports the response as:

<?xml version="1.0" encoding="UTF-8"?>
<MyRoot><MyText>FooManchu</MyText></MyRoot>

so it looks like its getting a correctly formatted XML packet.

I'm stumped.

Rey...

John Resig wrote:
> This should be more than sufficient:
> $.get( "test.cfm", function(msg){
>     alert( "Data Saved: " + $( "MyText", msg).text() );
> });
> 
> I only just added the success(msg) part last night, when I was writing
> the docs. Using $.get() is the simpler way to do it, plus it works now
> - sorry for the confusion.
> 
> --John
> 
> On 9/8/06, Rey Bango <[EMAIL PROTECTED]> wrote:
> 
>>No dice John. I updated the xml response to this:
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><MyRoot><MyText>FooManchu</MyText></MyRoot>
>>
>>and changed the .ajax call to this:
>>
>>$.ajax({ type: "GET",
>>         url: "test.cfm",
>>         dataType: "xml",
>>         success: function(msg){ alert( "Data Saved: " + $( "MyText", msg
>>).text() ); }
>>});
>>
>>and I get the same result. The alert window pops up but the text in the
>>child node "MyText" doesn't appear in the pop up.
>>
>>Rey...
>>
>>
>>John Resig wrote:
>>
>>>>The problem that I'm having is that the alert() box simply returns the
>>>>message "Data Saved:" without the corresponding text retrieved from the
>>>>script.
>>>
>>>
>>>The problem is that you're looking for a MyRoot element within the
>>>root element - which is MyRoot, which won't work. You have two
>>>options:
>>>
>>>1) $(msg).text()
>>>2) Put another element inside MyRoot named something else, like MyText:
>>>$("MyText",msg).text();
>>>
>>>--John
>>>
>>>_______________________________________________
>>>jQuery mailing list
>>>[email protected]
>>>http://jquery.com/discuss/
>>>
>>
>>_______________________________________________
>>jQuery mailing list
>>[email protected]
>>http://jquery.com/discuss/
>>
> 
> 
> 

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to