This package has been deprecated

Author message:

d

ajax-promise-simple

1.1.2 • Public • Published

Description

A ajax with promise, browser don't supports promise. browse supports promise see https://www.npmjs.com/package/ajax-promise-in-browser

一个浏览器不支持promise的ajax 浏览器支持promise的请使用https://www.npmjs.com/package/ajax-promise-in-browser

Usage 用法

var ajaxPromise = require('ajax-promise-simple')
 
/**
    有四个属性方法:
    ajaxPromise.get => return text
    ajaxPromise.getJSON  => return JSON
    ajaxPromise.post => return text
    ajaxPromise.postJSON  => return JSON
*/
 
ajaxPromise[get|getJSON|post|postJSON](url, params)
.then(function(data){
})
.catch(function(error){
})

ES5

var ajax = require('ajax-promise-simple')
 
ajax.get('http://***/login', 
    {username:aaa, password:123456})
.then(function(data){
})
.catch(function(error){
 
})

ES6

ajax.post('http://***/login', 
    {username:aaa, password:123456})
.then((data) => {
})
.catch((error) => {
 
})
 
 
 

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ajax-promise-simple

    Weekly Downloads

    14

    Version

    1.1.2

    License

    none

    Last publish

    Collaborators

    • edwwardzzz