Hi.

Nothing major, but the last section on
http://prototypejs.org/api/ajax/request (Evaluating JSON headers)
doesn't mention that the second parameter of the onSuccess() call
contains transport.headerJSON

Currently the manual says ...

-------------------------------
Some backends will return JSON not as response text, but in the X-JSON
header. In which case, you don't even need to evaluate the returned
JSON yourself, as Prototype automatically does so and passes it as the
headerJSON property of the Ajax.Response object. Note that if there is
no such header or its contents is invalid, this property will be set
to null.

new Ajax.Request('/your/url', {
  onSuccess: function(transport) {
    transport.headerJSON
  }
});
-------------------------------

Maybe this would be better as ...

-------------------------------
Some backends will return JSON not as response text, but in the X-JSON
header. In which case, you don't even need to evaluate the returned
JSON yourself, as Prototype automatically does so and passes it as the
second parameter to the onSuccess handler. Note that if there is no
such header or its contents is invalid, this property will be set to
null.

new Ajax.Request('/your/url', {
  onSuccess: function(transport, headerJSON) {
    // headerJSON contains the evaluated X-JSON header or null
  }
});
-------------------------------


Regards,

Richard Quadling.


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

--~--~---------~--~----~------------~-------~--~----~
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