0.1.3 • Published 6 years ago

@jojopr/miniajax v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

miniAJAX JavaScript library

miniAJAX is a small JavaScript library for AJAX Request

How to use

AJAX.GET('url', {
    '200': function(data) {
        // Called on HTTP 200, data = XMLHttpRequest.ResponseText
    },
    '404': function(data) {
        // Called on HTTP 404, data = XMLHttpRequest.ResponseText
    }
})

The AJAX.GET(url, callbacks = {}) takes a url for the request and an object, holding callback functions, stored by key = HTTP Status Code and value = function(data)

install

npm i @jojopr/miniAJAX

<script src="node_modules/@jojopr/miniajax/dist/miniAJAX.min.js"></script>

TODO:

  • Add Support for POST Requests