miniAjax
1.0.0
迷你 Ajax 函式庫為簡單的 Web 應用程式提供 Ajax、jsonp 和就緒功能。
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
miniAjax中只有3個接口,包括Ajax、jsonp和ready函數:
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
} )
幾乎支援所有的瀏覽器,甚至包括原始的IE系列。
壓縮版小於2K,如果使用gzip則小於1K。
Ajax
ready
滿足 Web 開發的jsonp
要求。
更多原則與用法可以取得 ->https://github.com/WeideMo/jsonp