Skip to content

πŸš€A mini Ajax library provides Ajax, jsonp and ready features for simple web applications.

License

Notifications You must be signed in to change notification settings

WeideMo/miniAjax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

miniAjax

A mini Ajax library provides Ajax, jsonp and ready features for simple web applications.

miniAjax

Browsers support

Chrome Firefox Safari Opera Edge IE
βœ” βœ” βœ” βœ” βœ” βœ”

Usage

There are only 3 interfaces in miniAjax, including Ajax, jsonp and ready functions:

ajax

ajax({
    url: "./testXhr.php",                       //links to server
    type: "POST",                               //request method
    data: { name: "WeideMo", age: 26 },         //request params
    dataType: "json",                           //received dataType
    success: function (response, xml) {
        // do something when success
    },
    fail: function (status) {
        // do something when fail
    }
});

jsonp

jsonp({
    url:"https://github.com/WeideMo/",  //links to server
    callback:"callback",                //reception callback name negotiated with the backend-server
    data:{id:"1000120"},                //request params
    success:function(json){
        // do something when success
    },
    fail:function(){
        // do something when fail
    },
    time:10000                          //custom timeout
})

ready

ready(function(){
    // do something when page ready
})

Fetures

High coverage of browsers

Almost support all of the browsers, even the original IE series.

light Weight

The compressed version is less than 2K, if you use gzip, it will be less than 1K.

Pure

MiniAjax is just the basic requirement to meet web development.It's only responsible for three things: Ajax , jsonp and ready.

More

You can get more principles and usage ->https://github.com/WeideMo/jsonp

About

πŸš€A mini Ajax library provides Ajax, jsonp and ready features for simple web applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published