2009/7/16 foolged <fool...@gmail.com>:
>
> 1494: success: function() {
> 1495:   var status = this.getStatus();
> 1496:   return !status || (status >= 200 && status < 300);
> 1497: }
>
>
> Why  !status  checked in line 1496?
> Because of this, an event onFailure not triggered when the status is
> == 0.
>
> IMHO rightly so, without !status.
> 1496: return (status> = 200 & & status <300);
>
>
> >
>

Hi.

I recently read [1] regarding "How To - Bulletproof Ajax Requests".

Out of that "How To", I see that the use of an on0 callback is useful.

I would like to be able to use an on0 Responder. Defining an on0
callback for every request/periodical/update AJAX call sort of rubs me
wrong. Duplication of code, maintenance issues, etc.

Having a global responder for on0 would allow me to define in a single
place how I want to handle the demise/inaccessibility of the web
server.

Currently, there is no support for the onXYZ responders, just
callbacks which need to be defined for every
request/periodical/update.

I've had a ticket (with a patch) which I've been using for over 2
years now [2]. The patch on the ticket is probably out of date. I can
submit a new one if required.

The one thing that is slightly different about the onXYZ responders is
that they can control the cascade to the onSuccess/onFailure callback.
If the onXYZ responder returns true, then the normal
onSuccess/onFailure callback can be called. If false, this inhibits
the onSuccess/onFailure callback. Specifically, an on0 responder
should return false to stop the onSuccess route from being followed.

Is there any interest in such a mechanism?

Regards,

Richard Quadling.


[1] http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests
[2] http://dev.rubyonrails.org/ticket/9690


-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
ZOPA : http://uk.zopa.com/member/RQuadling

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

Reply via email to