@jojopr/miniajax
v0.1.3
Published
A small JS Library for AJAX
Downloads
1
Maintainers
Readme
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