GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DANCER2::PLUGIN::AJAX (3)

.ds Aq ’

NAME

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

CONTENTS

VERSION

version 0.200001

SYNOPSIS



    package MyWebApp;

    use Dancer2;
    use Dancer2::Plugin::Ajax;

    # For GET / POST
    ajax /check_for_update => sub {
        # ... some Ajax code
    };

    # For all valid HTTP methods
    ajax [get, post, ... ] => /check_for_more => 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:
o Pass if the request header X-Requested-With doesn’t equal XMLHttpRequest
o Disable the layout
o The action built matches POST / GET requests by default. This can be extended by passing it an ArrayRef of allowed HTTP methods.

CONFIGURATION

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

Here is example to use JSON:



  plugins:
    Ajax:
      content_type: application/json



AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DANCER2::PLUGIN::AJAX (3) 2016-01-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.