Musachy,
That seems to work. I now see the proper response when I call
response[0].name. Thanks.
-Ryan
-----Original Message-----
From: Musachy Barroso [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2008 3:45 PM
To: Struts Users Mailing List
Subject: Re: [struts] JSON plugin
If response[i] is a char then the response is a text, not an object.
If I don't remember wrong dojo builds the object for you when the
mimetype is "application/json", but I am not sure right now. Use the
"eval" function to turn the text into an object.
musachy
On Thu, Mar 13, 2008 at 5:31 PM, Stanley, Eric
<[EMAIL PROTECTED]> wrote:
> Dale,
> I am using dojo, so here is the snippet that handles the
> request/response:
>
> var kw = {
> url: url,
> mimetype: "text/json",
> method: "POST",
> load: function(responseObject, ioArgs) {
> console.debug(responseObject[0].name); // Dump it to the
> console
>
> return responseObject;
> },
> error: function(data){
> alert("An error occurred: " + data);
> },
> timeout: 10000,
> };
> dojo.xhrPost(kw);
>
> -Ryan
>
>
> -----Original Message-----
> From: Dale Newfield [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 13, 2008 3:28 PM
> To: Struts Users Mailing List
>
>
> Subject: Re: [struts] JSON plugin
>
> Stanley, Eric wrote:
> > I tried just printing out responseObject[i]
>
> How in your javascript code do you convert the text of the response
> into responseObject?
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> This communication is the property of Qwest and may contain
> confidential or privileged information. Unauthorized use of this
> communication is strictly prohibited and may be unlawful. If you
> have received this communication in error, please immediately notify
> the sender by reply e-mail and destroy all copies of the
communication and any attachments.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]