logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

       Dancer Core Developers

Configuration

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

       Here is example to use JSON:

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

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:

       •   Pass if the request header X-Requested-With doesn't equal XMLHttpRequest

       •   Disable the layout

       •   The action built matches POST / GET requests.

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;

Version

       version 1.3521

See Also