NYCPHP Meetup

NYPHP.org

[nycphp-talk] Ajax 101: what to return from a POST

David Mintz vtbludgeon at gmail.com
Thu May 3 14:55:28 EDT 2007


Ah so, makes sense. The thing about the JSON header is nice. But I want to
show the each message in a DIV adjacent to the corresponding form element.
So sending one HTML fragment of error text wouldn't quite do it.

On 5/3/07, Tim Lieberman <tim_lists at o2group.com> wrote:
>
> If there are validation errors, send back a json-encoded false in the
> X-JSON header, and some error HTML to be injected into a DOM element in the
> body.
>
> If there are no errors, send back a json-encoded true in the X-JSON
> header, and do whatever else you need in the responseText. [...]
>

-- 
David Mintz
http://davidmintz.org/

Just a spoonful of sugar helps the medicine go down
In the most delightful way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070503/66292486/attachment.html>


More information about the talk mailing list