1Dancer::Plugin::Ajax(3)User Contributed Perl DocumentatioDnancer::Plugin::Ajax(3)
2
3
4

NAME

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

VERSION

9       version 1.3400
10

SYNOPSIS

12           package MyWebApp;
13
14           use Dancer;
15           use Dancer::Plugin::Ajax;
16
17           ajax '/check_for_update' => sub {
18               # ... some Ajax code
19           };
20
21           dance;
22

DESCRIPTION

24       The "ajax" keyword which is exported by this plugin allow you to define
25       a route handler optimized for Ajax queries.
26
27       The route handler code will be compiled to behave like the following:
28
29       ·   Pass if the request header X-Requested-With doesnt equal
30           XMLHttpRequest
31
32       ·   Disable the layout
33
34       ·   The action built matches POST / GET requests.
35

CONFIGURATION

37       By default the plugin will use a content-type of 'text/xml' but this
38       can be overwritten with plugin setting 'content_type'.
39
40       Here is example to use JSON:
41
42         plugins:
43           'Ajax':
44             content_type: 'application/json'
45

AUTHOR

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

AUTHOR

50       Dancer Core Developers
51
53       This software is copyright (c) 2010 by Alexis Sukrieh.
54
55       This is free software; you can redistribute it and/or modify it under
56       the same terms as the Perl 5 programming language system itself.
57
58
59
60perl v5.28.0                      2018-06-15           Dancer::Plugin::Ajax(3)
Impressum