0.2.0 • Published 8 years ago
k_ajax v0.2.0
K-Ajax
Hope is the most useful you used js library of the ajax
- Small: Size as small as possible
- Easy: Api as simple as possible
Examples
//k_ajax.xxx(url,data,success,error,isAsync)
k_ajax.getJSON('http://qiniu.404mzk.com/example.json',{},function(result){
document.getElementById('get').innerHTML = result
})
k_ajax.getJSONP('http://inner.journey.404mzk.com/jsonp_demo',{},function(result){
document.getElementById('jsonp').innerHTML = JSON.stringify(result)
})
k_ajax.post('http://qiniu.404mzk.com/example.json',{},function(result){
document.getElementById('post').innerHTML = result
})
k_ajax.useImg('http://qiniu.404mzk.com/example.json',{'hello': 'k'})
Installation
<script src="http://qiniu.404mzk.com/K-Ajax_0.0.1.js"></script>
And it's just as easy with npm:
npm i --save npm install K--Ajax