Dancer::Plugin::Ajax - a plugin for adding Ajax route handlers


Dancer documentation  | view source Contained in the Dancer distribution.

Index


NAME

Top

Dancer::Plugin::Ajax - a plugin for adding Ajax route handlers

SYNOPSIS

Top

    package MyWebApp;

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

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

    dance;

DESCRIPTION

Top

The ajax keyword which is exported by this plugin allow you to define a route handler optimized for Ajax queries.

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.

AUTHOR

Top

This module has been written by Alexis Sukrieh <sukria@sukria.net>


Dancer documentation  | view source Contained in the Dancer distribution.