miniAjax
1.0.0
ミニ Ajax ライブラリは、Ajax、jsonp、および単純な Web アプリケーション用のすぐに使える機能を提供します。
| ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
miniAjax には、Ajax、jsonp、ready 関数を含む 3 つのインターフェイスしかありません。
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未満になります。
MiniAjax は、Web 開発を満たすための基本的な要件にすぎません。Ajax 、 jsonp 、およびready Ajaxつのことのみを担当します。
さらに多くの原理と使用法を入手できます ->https://github.com/WeideMo/jsonp