I don't see how passing you all the information is "inflexible", on  
the contrary I would find writing a handler for a code and realizing  
there was another status code that needs the same handling to be what  
is really inflexible.

If you have different handing based on different status codes then  
break up your handlers by what they do into diferent functions and  
simply write a switch statement that calls the relevant function. I  
don't see how that isn't flexible as the definition of flexibility in  
this case is the ability to bend the code to do something slightly  
different (like have a second status code share the handler of  
another) with easev(like adding a new case line into a switch).

~Daniel Friesen (DanTMan, Nadir Seen Fire) [http://daniel.friesen.name]

On 7-Sep-09, at 3:24 PM, Nathan Bubna <nbu...@gmail.com> wrote:

>
> On Mon, Sep 7, 2009 at 12:08 PM, John Snyders<jjsnyd...@rcn.com>  
> wrote:
>>
>> I would like to add my opinion.
> ...
>> I do not think individual callbacks for each status code are a good
>> idea.
>
> Why?
>
> Do you not use XHR with services where you need to do different things
> depending on which 4xx code (for example) you receive back?  Or do you
> just prefer to organize your branching as a switch/case or if/elseif
> within an error callback?
>
> In my current app, fairly different handlers are required for say, 401
> than 405 or 404, and embedding the branching within switch/case or
> if/elseif is ugly and inflexible.  This also happens to be a feature
> which would be much simpler and better to implement in the core ajax
> code than in a plugin.
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to