From e684193f7c33b45684d4c6ad64177e5aedcdb92c Mon Sep 17 00:00:00 2001 From: David Zurborg Date: Tue, 17 Jun 2014 19:22:52 +0200 Subject: [PATCH] add documentation --- lib/Dancer/Serializer/JSONP.pm | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/lib/Dancer/Serializer/JSONP.pm b/lib/Dancer/Serializer/JSONP.pm index 2b911dcc9..d640c2a75 100644 --- a/lib/Dancer/Serializer/JSONP.pm +++ b/lib/Dancer/Serializer/JSONP.pm @@ -18,3 +18,51 @@ sub serialize { sub content_type {'application/javascript'} 1; +__END__ + +=head1 NAME + +Dancer::Serializer::JSONP - serializer for handling JSONP data + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +This class is a subclass of L with support for JSONP. + +In order to use this engine, use the template setting: + + serializer: JSONP + +This can be done in your config.yml file or directly in your app code with the +B keyword. This serializer will B be used when the serializer is set +to B. + +All configuration options mentioned in L apply here, +too. + +=head1 METHODS + +=head2 serialize + +Serialize a data structure to a JSON structure with surrounding javascript +callback method. The name of the callback method is obtained from the request +parameter I. + +=head2 deserialize + +See L. + +=head2 content_type + +Return 'application/javascript' + +=head1 SEE ALSO + +L is a modern alternative to JSONP, but with limited +browser support. Today, JSONP can be a serious fallback solution when CORS is +not supported by a browser. + +=head1 AUTHOR + +David Zurborg, C<< >>