Dancer2::Plugin::Ajax - a plugin for adding Ajax route handlers
version 0.09
package MyWebApp; use Dancer2; use Dancer2::Plugin::Ajax; ajax '/check_for_update' => sub { # ... some Ajax code }; dance;
The ajax keyword which is exported by this plugin allow you to define a route handler optimized for Ajax queries.
ajax
The route handler code will be compiled to behave like the following:
Pass if the request header X-Requested-With doesnt equal XMLHttpRequest
Disable the layout
The action built is a POST request.
Dancer Core Developers
This software is copyright (c) 2013 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.
To install Dancer2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2
CPAN shell
perl -MCPAN -e shell install Dancer2
For more information on module installation, please visit the detailed CPAN module installation guide.