documentation correction

0 views
Skip to first unread message

drewB

unread,
Oct 13, 2009, 2:30:25 PM10/13/09
to Prototype: Core
On page http://www.prototypejs.org/api/ajax/request at the bottom when
describing how JSON is handled it says that the JSON is evaluated and
returned in the headerJSON property. It should say responseJSON. The
same is true of the sample code.

T.J. Crowder

unread,
Oct 14, 2009, 4:16:13 AM10/14/09
to Prototype: Core
Hi,

On Oct 13, 7:30 pm, drewB <dbats...@gmail.com> wrote:
> On pagehttp://www.prototypejs.org/api/ajax/requestat the bottom when
> describing how JSON is handled it says that the JSON is evaluated and
> returned in the headerJSON property.  It should say responseJSON.  The
> same is true of the sample code.

Thanks for that, but actually, it's correct. That section is talking
about the X-JSON header ("Some backends will return JSON not as
response text, but in the X-JSON header..."). The X-JSON header is
deserialized and made available as headerJSON. So you can return HTML
(for instance) along with a bit of JSON in a header. You're thinking
of when the main content comes back as application/json, in which case
it is indeed available as responseJSON.

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com
Reply all
Reply to author
Forward
0 new messages