Hash: SHA1

On Jun 22, 2010, at 2:45 AM, T.J. Crowder wrote:
> The answer is in the question. :-) If it's a non-HTTP error, it
> wouldn't be best practice to use an HTTP error code to represent the
> error. (Not that HTTP status codes don't have a fair bit of scope
> creep in them already.)

That's what I figured, but I wanted to make sure I was on the right track ...

> I've standardized by having *all* of my Ajax calls return data in the
> same way. They all return JSON-formatted data, and the format for
> success is always:

This is similar to what I was thinking.  In the end, I'll have a bit of 
framework I can use in other applications..

> In any given application, I tend to have a  wrapper around Prototype's
> ajax stuff with some problem-domain logic in it. That wrapper always
> checks for the `success` flag on calls and routes to the error handler
> if it's not there.

Which would, I suppose, extend the framework to be even more generic..  Hrm..  
Presumably this is just a simple subroutine call?  Not much of a performance 
hit, is it?

> --
> T.J. Crowder

- ---------------------------
Jason 'XenoPhage' Frisvold
- ---------------------------
"Any sufficiently advanced magic is indistinguishable from technology."
- - Niven's Inverse of Clarke's Third Law

Version: GnuPG/MacGPG2 v2.0.14 (Darwin)


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-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to