miniAjax
1.0.0
Uma mini biblioteca Ajax fornece Ajax, jsonp e recursos prontos para aplicativos da web simples.
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Existem apenas 3 interfaces no miniAjax, incluindo Ajax, jsonp e funções prontas:
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 ( {
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 ( function ( ) {
// do something when page ready
} )
Quase suporta todos os navegadores, até mesmo a série original do IE.
A versão compactada tem menos de 2K, se você usar gzip será menor que 1K.
MiniAjax é apenas o requisito básico para atender ao desenvolvimento web. Ele é responsável apenas por três coisas: Ajax
, jsonp
e ready
.
Você pode obter mais princípios e uso ->https://github.com/WeideMo/jsonp