miniajax

0.0.2 • Public • Published

mini ajax

A micro ajax module

useage

npm install miniajax
//browser
var ajax = window.returnExports.ajax
//get
ajax({
  url: 'xxxx',
  onSuccess: function(data) {
    alert('success: ' + data)
  },
  onError: function(msg) {
    alert('error: ' + data)
  }
})
 
//post
ajax({
  type: 'post',
  url: 'xxxx',
  data: 'xxx=sfjsldf',
  onSuccess: function(data) {
    alert('success: ' + data)
  },
  onError: function(msg) {
    alert('error: ' + data)
  }
})

test

npm install
node testServer.js

Readme

Keywords

Package Sidebar

Install

npm i miniajax

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • jserme