On Sep 16, 9:38 am, MichaelS <[EMAIL PROTECTED]> wrote:
> json.errors isn't an array, but an undefined object. You can't use it

What exactly is an "undefined object"?

> like an array and casting it to $A doesn't help either. Since the
> errors coming back originally were an array, you'd think this would
> work, but it doesn't.
>
> The frustration is that the original code works when json.errors has
> values, but doesn't when it's empty.

It shouldn't matter if `errors` is represented as an empty array
(rather than `undefined`, if I understand you correctly)

>
> The code that creates the json:
>             $json = array('errors' => $fp->getErrors());
>             $this->sendJson($json);
>
> Any thoughts on how we could evaluate json.errors when it's an empty
> representation( "{"errors":[]}")?

'{"errors":[]}'.evalJSON().errors; // [];
'{"errors":[]}'.evalJSON().errors.length; // 0;

I'm not following what the issue is.

>
> MS

--
kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to