Dancer...::JSONP(3pm)

✨ NAME ✨

Dancer::Serializer::JSONP β€” bestie, this is the serializer for handling JSONP data πŸ’–

(it lives in the Perl-y corner of the world, 3pm, User Contributed Perl Documentation, and yes she's that JSONP girlie 🌈)


🌸 VERSION 🌸

version 1.3522 β€” locked in, no cap πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

okay so this section is literally just vibes rn β€” the original page ships it empty πŸ’€ nothing to copy here, we move.


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen: this class is a subclass of Dancer::Serializer::JSON that comes with JSONP support bolted on. like, JSON but make it callback-flavoured ✨

to actually use this engine, you set the template setting:

serializer: JSONP

you can do that in your config.yml file, or directly in your app code with the set keyword. super easy, main character energy πŸ’…

important!! this serializer will not be used when the serializer is set to mutable. like, it just won't. πŸ™‚β€β†”οΈ

and also: all configuration options mentioned in Dancer::Serializer::JSON apply here, too. every single one, fr fr 🫢


πŸ’… METHODS πŸ’…

serialize

serialize a data structure to a JSON structure with a javascript callback method wrapped around it πŸŽ€ the name of that callback method is obtained from the request parameter callback. iykyk ✨

deserialize

see Dancer::Serializer::JSON#deserialize. that's it, that's the whole note, go peek there bestie πŸ’œ

content_type

returns 'application/javascript' β€” periodt πŸ“


⭐ SEE ALSO ⭐

  • Dancer::Plugin::CORS 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. like, the backup bestie who always shows up πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

David Zurborg, "<zurborg at cpan.org>" πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Dancer Core Developers 🌸


This software is copyright (c) 2010 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page bestie!! this was Dancer...::JSONP(3pm), shipped with perl v5.40.1, dated 2026-05-05, and honestly? she ate. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from