Yanick Champoux > Dancer-1.3119 > Dancer::Plugin::Ajax

Download:
Dancer-1.3119.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.00   Source   Latest Release: Dancer-1.3130

NAME ^

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

SYNOPSIS ^

    package MyWebApp;

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

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

    dance;

DESCRIPTION ^

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:

CONFIGURATION ^

By default the plugin will use a content-type of 'text/xml' but this can be overrided with plugin setting 'content_type'.

Here is example to use JSON:

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

AUTHOR ^

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

syntax highlighting: