<Script language = "javascript" type = "text/javascript"> $. Ready (function BtnSpareClick (){ $. Ajax ({ Type: "get ", Url: "http://www.jb51.net/windy2008/rss ", Data :{}, Global: false, BeforeSend: function (data, status, settings ){ $ ("# Process"). text ("before Part request starts "); Alert ($ ("# Process"). text ()); }, Success: function (data, status, settings ){ $ ("Item", data). each (function (I, domEle ){ $ ("# Result"). append ("<div>" + $ (domEle). children ("title"). text () + "</div> "); }); $ ("# Process"). text ("When Part request is successful "); Alert ($ ("# Process"). text ()); }, Complete: function (data, status, settings ){ $ ("# Process"). text ("When Part request is completed "); Alert ($ ("# Process"). text ()); }, Error: function (data, status, settings ){ $ ("# Process"). text ("Part request error "); Alert ($ ("# Process"). text ()); } }); }); </Script> |
<Script language = "javascript" type = "text/javascript"> $. Ready (function BtnGlobalClick (){ $. Get ("http://www.jb51.net/windy2008/rss", {}, function (data, status, settings) { $ ("Item", data). each (function (I, domEle ){ $ ("# Result"). append ("<div>" + $ (domEle). children ("title"). text () + "</div> "); }); }); $ ("# Process"). ajaxStart (function (){ Alert ($ (this). text ()); $ (This). text ("starting a new Ajax request "); }); $ ("# Process"). ajaxStop (function (){ $ (This). text ("when no Ajax is in progress "); Alert ($ (this). text ()); }); $ ("# Process"). ajaxSend (function (){ $ (This). text ("Before Request start "); Alert ($ (this). text ()); }); $ ("# Process"). ajaxSuccess (function (){ $ (This). text ("request successful "); Alert ($ (this). text ()); }); $ ("# Process"). ajaxComplete (function (){ $ (This). text ("when the request is completed "); Alert ($ (this). text ()); }); $ ("# Process"). ajaxError (function (){ $ (This). text ("request error "); Alert ($ (this). text ()); }); }); </Script> |