|
<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 the part Request begins");
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 the part Request succeeds");
Alert ($ ("#Process"). Text ());
},
Complete:function (data, status, settings) {
$ ("#Process"). Text ("When the part Request completes");
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 ("Start a new Ajax request");
});
$ ("#Process"). Ajaxstop (function () {
$ (this). Text ("When there is no Ajax in progress");
Alert ($ (this). text ());
});
$ ("#Process"). Ajaxsend (function () {
$ (this). Text (before "request starts");
Alert ($ (this). text ());
});
$ ("#Process"). Ajaxsuccess (function () {
$ (this). Text ("successful request");
Alert ($ (this). text ());
});
$ ("#Process"). Ajaxcomplete (function () {
$ (this). Text ("Upon completion of request");
Alert ($ (this). text ());
});
$ ("#Process"). Ajaxerror (function () {
$ (this). Text (when "error requested");
Alert ($ (this). text ());
});
});
</script> |