miniAjax
1.0.0
Eine Mini-Ajax-Bibliothek bietet Ajax-, JSONP- und fertige Funktionen für einfache Webanwendungen.
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
In miniAjax gibt es nur drei Schnittstellen, darunter Ajax, JSONP und Ready-Funktionen:
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
} )
Unterstützt fast alle Browser, sogar die ursprüngliche IE-Serie.
Die komprimierte Version ist weniger als 2 KB groß. Wenn Sie gzip verwenden, ist sie weniger als 1 KB groß.
MiniAjax ist lediglich die Grundvoraussetzung für die Webentwicklung. Es ist nur für drei Dinge verantwortlich: Ajax
, jsonp
und ready
.
Weitere Prinzipien und Verwendung finden Sie ->https://github.com/WeideMo/jsonp