Catalyst-View-JSON
view release on metacpan or search on metacpan
NOTE For another way to enable JSONP in your application take a look at
Plack::Middleware::JSONP
INTEROPERABILITY
JSON use is still developing and has not been standardized. This section
provides some notes on various libraries.
Dojo Toolkit: Setting dojo.io.bind's mimetype to 'text/json' in the
JavaScript request will instruct dojo.io.bind to expect JSON data in the
response body and auto-eval it. Dojo ignores the server response
Content-Type. This works transparently with Catalyst::View::JSON.
Prototype.js: prototype.js will auto-eval JSON data that is returned in
the custom X-JSON header. The reason given for this is to allow a
separate HTML fragment in the response body, however this of limited use
because IE 6 has a max header length that will cause the JSON evaluation
to silently fail when reached. The recommend approach is to use
Catalyst::View::JSON which will JSON format all the response data and
return it in the response body.
In at least prototype 1.5.0 rc0 and above, prototype.js will send the
lib/Catalyst/View/JSON.pm view on Meta::CPAN
at L<Plack::Middleware::JSONP>
=head1 INTEROPERABILITY
JSON use is still developing and has not been standardized. This
section provides some notes on various libraries.
Dojo Toolkit: Setting dojo.io.bind's mimetype to 'text/json' in
the JavaScript request will instruct dojo.io.bind to expect JSON
data in the response body and auto-eval it. Dojo ignores the
server response Content-Type. This works transparently with
Catalyst::View::JSON.
Prototype.js: prototype.js will auto-eval JSON data that is
returned in the custom X-JSON header. The reason given for this is
to allow a separate HTML fragment in the response body, however
this of limited use because IE 6 has a max header length that will
cause the JSON evaluation to silently fail when reached. The
recommend approach is to use Catalyst::View::JSON which will JSON
format all the response data and return it in the response body.
( run in 0.384 second using v1.01-cache-2.11-cpan-0a6323c29d9 )