> Looks like success() returns TRUE all the time as foolged said.

Yes, if getStatus returns 0 (either because the HTTP status code
really came back from the browser as 0, or because the browser didn't
supply one at all), then success will return true.  This has been
noted before.[1][2]

I'd love to hear from one of the core devs (NOT just someone active on
this list like myself) *why* zero is considered success, because it
doesn't make sense to me.  The server being offline is certainly not a
successful outcome.  Most of the contributors to Prototype are not
dumb, it's there for a reason, I just want to know what the reason is
since they didn't feel it deserved a comment in the source.

[1] http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests
[2] 
http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/6d1d9fc7aa1e927a
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 16, 1:52 pm, dmitrymos <dmitry...@gmail.com> wrote:
> Alex, what does success() return if getStatus() returns 0 in case of
> error?
>
> Looks like success() returns TRUE all the time as foolged said.
>
> On Jul 16, 7:37 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
> wrote:
>
>
>
> > as it states.......
>
> > Return !status (NOT STATUS) || (OR) status greater than or equal to 200
> > (TRUE|FALSE) && status LESS THAN 300
>
> > as i said again it returns a true false
>
> > ----- Original Message -----
> > From: "foolged" <fool...@gmail.com>
> > To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
> > Sent: Thursday, July 16, 2009 10:42 AM
> > Subject: [Proto-Scripty] Re: checked !status in line 1496?
>
> > (prototype-1.6.1.RC3)
>
> > > Hi All
> > > You do not understand my question.
> > > I asked, not what is returned.
> > > I asked what is checked! status?
>
> > > IMHO rightly so.
> > > return (status> = 200 & & status <300);
--~--~---------~--~----~------------~-------~--~----~
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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to