1.3.0 • Published 8 years ago

chialab-ajax v1.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Ajax

A XMLHttpRequest wrapper.

Install

NPM

$ npm i chialab-ajax --save

Bower

$ bower i chialab-ajax --save

Example

// GET request
var xhrGet = Ajax.get('http://my.api.url/')
    .then(function(res) {
        console.log('Result:', res);
    }, function(xhr) {
        console.error('Error:', xhr.response);
    });

// POST request
var xhrPost = Ajax.post('http://my.api.url/', { title: 'Hello.' })
    .then(function(res) {
        console.log('Result:', res);
    }, function(xhr) {
        console.error('Error:', xhr.response);
    });

Dev

Chialab es6-workflow Travis Code coverage

Sauce Test Status

1.3.0

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago