[jQuery] Re: Status Codes => docs

2009-02-12 Thread Tim Johnson

On Thursday 12 February 2009, Mike Alsup wrote:
> > Textual status is fine.
> > Where is documentation on status strings?
> > Thanks
> > Tim
>
> When the 'success' handler is invoked the textual status is always
> "success" (unless you're using the ifModified option).
>
> When the 'error' handler is invoked the textual status may be "error",
> "parsererror", or "timeout".
>
> When the 'complete' handler is invoked the textual status may be any
> of those mentioned above.
>
> Both the 'complete' and 'error' callbacks are passed the XHR as the
> first arg.  With that object you can determine the HTTP status via its
> 'status' property.
Understood. Thanks.
> I couldn't find a wiki page that succinctly covers this so I'll make a
> note to add one.
 Good idea.
 regards
 tim




[jQuery] Re: Status Codes => docs

2009-02-12 Thread Mike Alsup


> Textual status is fine.
> Where is documentation on status strings?
> Thanks
> Tim

When the 'success' handler is invoked the textual status is always
"success" (unless you're using the ifModified option).

When the 'error' handler is invoked the textual status may be "error",
"parsererror", or "timeout".

When the 'complete' handler is invoked the textual status may be any
of those mentioned above.

Both the 'complete' and 'error' callbacks are passed the XHR as the
first arg.  With that object you can determine the HTTP status via its
'status' property.

I couldn't find a wiki page that succinctly covers this so I'll make a
note to add one.

Mike


[jQuery] Re: Status Codes => docs

2009-02-12 Thread Tim Johnson

On Thursday 12 February 2009, Mike Alsup wrote:
> >  Sorry.
> >  To clarify, I wanted ed to know if numerical statuses via the w3
> > protocol or text strings were being returned. I just did my first
> > successful ajax call using jquery and the status returned in the callback
> > was "success", not 200.
> >
> >  I hope the question is clearer now.
> >  thanks
> >  tim
>
> The HTTP status code is not returned to the success handler, only
> textual status is. 
Hi Mike:
Textual status is fine.
Where is documentation on status strings?
Thanks
Tim


[jQuery] Re: Status Codes => docs

2009-02-12 Thread Mike Alsup

>  Sorry.
>  To clarify, I wanted ed to know if numerical statuses via the w3 protocol
>  or text strings were being returned. I just did my first successful ajax
>  call using jquery and the status returned in the callback was "success", not
> 200.
>
>  I hope the question is clearer now.
>  thanks
>  tim

The HTTP status code is not returned to the success handler, only
textual status is.  If you need the numberical value you can use the
'complete' handler instead (with $.ajax).  The 'complete' handler is
passed the xhr object so you can interrogate it as needed.


[jQuery] Re: Status Codes => docs

2009-02-12 Thread Tim Johnson

On Wednesday 11 February 2009, Nic Luciano wrote:
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>
> Something like this?
>
> I might be misunderstanding your question, but I don't think statuses and
> datatypes are related if that's what you mean. Status codes (linked) are
> the status of the call.. (ie. a return status of 200 means everything went
> OK). Data type is the format of the data you are expecting to return (html
> for plain html to insert into your document, json for js objects, etc)...
 Sorry.
 To clarify, I wanted ed to know if numerical statuses via the w3 protocol
 or text strings were being returned. I just did my first successful ajax
 call using jquery and the status returned in the callback was "success", not 
200.

 I hope the question is clearer now.
 thanks
 tim


[jQuery] Re: Status Codes => docs

2009-02-12 Thread Mike Alsup

> I would be grateful if someone could point me to documentation
> on status codes.
>
> Example: $post() expects a callback function whose second argument
> would be status.
> What statuses should I expect and what datatype for statuses
> should I expect.
> Links to docs would be more than adequate.

http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype


[jQuery] Re: Status Codes => docs

2009-02-11 Thread Nic Luciano
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Something like this?

I might be misunderstanding your question, but I don't think statuses and
datatypes are related if that's what you mean. Status codes (linked) are the
status of the call.. (ie. a return status of 200 means everything went OK).
Data type is the format of the data you are expecting to return (html for
plain html to insert into your document, json for js objects, etc)...

Nic Luciano
http://www.twitter.com/nicluciano
http://www.linkedin.com/in/nicluciano

On Wed, Feb 11, 2009 at 8:52 PM, Tim Johnson  wrote:

>
> I would be grateful if someone could point me to documentation
> on status codes.
>
> Example: $post() expects a callback function whose second argument
> would be status.
> What statuses should I expect and what datatype for statuses
> should I expect.
> Links to docs would be more than adequate.
>
> _Thanks In Advance_ and thanks for all the help I've had so far.
> tim
>