GithubHelp home page GithubHelp logo

sunlianlong / miniajax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from weidemo/miniajax

0.0 0.0 0.0 5 KB

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

License: MIT License

JavaScript 100.00%

miniajax's Introduction

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

miniajax's People

Contributors

weidemo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.