miniAjax
1.0.0
Una mini biblioteca Ajax proporciona funciones Ajax, jsonp y listas para aplicaciones web simples.
| ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Solo hay 3 interfaces en miniAjax, incluidas Ajax, jsonp y funciones listas:
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
} ) Casi es compatible con todos los navegadores, incluso la serie IE original.
La versión comprimida es inferior a 2K, si usa gzip, será inferior a 1K.
MiniAjax es solo el requisito básico para cumplir con el desarrollo web. Solo es responsable de tres cosas: Ajax , jsonp y ready .
Puede obtener más principios y uso ->https://github.com/WeideMo/jsonp