Dancer::Plugin::Ajax - a plugin for adding Ajax route handlers
package MyWebApp; use Dancer; use Dancer::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.
This module has been written by Alexis Sukrieh <sukria@sukria.net>
To install Dancer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer
CPAN shell
perl -MCPAN -e shell install Dancer
For more information on module installation, please visit the detailed CPAN module installation guide.