Dancer...::Ajax(3pm)

πŸ’– Dancer::Plugin::Ajax β€” the manual page, bestie edition πŸ’–

okay so before we even start: this is the manpage for Dancer::Plugin::Ajax(3pm), living in the User Contributed Perl Documentation section. Say hi. She's a plugin, she's cute, she adds Ajax route handlers, and she's about to make your whole webapp feel like main character energy. ✨


🌸 NAME 🌸

Dancer::Plugin::Ajax β€” a plugin for adding Ajax route handlers. that's the whole vibe. that's the job. πŸ’…


πŸŽ€ VERSION πŸŽ€

version 1.3522 β€” yes bestie, that's the number, we're not rounding it, we're not fixing it, it's iconic as-is. πŸ”₯


✨ SYNOPSIS ✨

here's the little ritual you do to summon it:

package MyWebApp;

use Dancer;
use Dancer::Plugin::Ajax;

ajax '/check_for_update' => sub {
    # ... some Ajax code
};

dance;

look at you, using Dancer, pulling in the plugin, dropping an ajax route like it's nothing, and then dance-ing. no cap, that's the whole flow. πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

so the ajax keyword that this plugin exports? it lets you define a route handler that's optimized for Ajax queries. fancier than your average route, fr fr.

your route handler code gets compiled to behave exactly like this, no more, no less:

  • it passes if the request header X-Requested-With doesn't equal XMLHttpRequest πŸ‘€
  • it disables the layout (nope, no layout for you, this route is working solo)
  • the action it builds matches POST / GET requests

and that's it. that's the whole personality. lowkey elegant, highkey useful. πŸ‘‘


🌈 CONFIGURATION 🌈

by default the plugin rolls with a content-type of 'text/xml' β€” but bestie, you can absolutely override that with the plugin setting 'content_type'. your app, your rules. 🫢

here's the example for switching to JSON, and honestly? she ate:

plugins:
  'Ajax':
    content_type: 'application/json'

πŸ’œ AUTHOR πŸ’œ

This module has been written by Alexis Sukrieh <sukria@sukria.net> β€” king behaviour. πŸ‘‘


⭐ AUTHOR ⭐

Dancer Core Developers β€” the whole squad, assembled. 🌈


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. slay, no strings, just Perl energy. πŸŽ€

real talk bestie: free software is free software β€” the terms are literally "same as Perl 5", so go read those if you need the fine print. we keep every word.

and that's the page!! πŸ’– this little beauty came from perl v5.40.1, dated 2026-05-05, and it's filed under Dancer...::Ajax(3pm). go forth and ajax responsibly, bestie. πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from