node package manager

can-ajax

can-ajax

Greenkeeper badge

Build Status

jQuery-inspired AJAX request library.

Usage

ES6 use

With StealJS, you can import this module directly in a template that is autorendered:

import plugin from 'can-ajax';

CommonJS use

Use require to load can-ajax and everything else needed to create a template that uses can-ajax:

var plugin = require("can-ajax");

AMD use

Configure the can and jquery paths and the can-ajax package:

<script src="require.js"></script>
<script>
    require.config({
        paths: {
            "jquery": "node_modules/jquery/dist/jquery",
            "can": "node_modules/canjs/dist/amd/can"
        },
        packages: [{
             name: 'can-ajax',
             location: 'node_modules/can-ajax/dist/amd',
             main: 'lib/can-ajax'
        }]
    });
    require(["main-amd"], function(){});
</script> 

Standalone use

Load the global version of the plugin:

<script src='./node_modules/can-ajax/dist/global/can-ajax.js'></script>