2.0.0 • Published 7 years ago

ajax.js v2.0.0

Weekly downloads
16
License
-
Repository
github
Last release
7 years ago

ajax.js

Simple Network Requests for browser and NodeJS. This folder can be loaded as a Chrome Extension to include in web pages.

OR
var AJAX = require('ajax.js');

try {
  var AJAX = require('.');
} catch(e){
  var AJAX = require('ajax.js');
}

// Promise
AJAX.get('https://httpbin.org/get?a=1').then(console.log);

// Callback
AJAX.get('https://httpbin.org/get?a=1', null, (o)=>{
  console.log('lets try a callback..', o);
});

AJAX.post('https://httpbin.org/post', {data: {b: 2}}, (o)=>{
  console.log('lets try a POST..', o);
});

AJAX.post('https://httpbin.org/post', {data: {c: 3}, headers: {myMeta: 'data'}}, (o)=>{
  console.log('lets try a header..', o);
});
2.0.0

7 years ago

0.0.8

9 years ago

0.0.4

9 years ago

0.0.1

9 years ago