jquery 1.1中文手册
http://www.cn-cuckoo.com/jquery/cnapi/jquery_a110.xml
http://jquery.org.cn/visual/cn/index.xml
<
HTML
>
<
SCRIPT
LANGUAGE
="JavaScript"
src
="jquery1.2.js"
></
SCRIPT
>

<
SCRIPT
LANGUAGE
="JavaScript"
>
...
<!--
$(function()...{
$("#loading").ajaxStart(function()...{
$(this).show();
});
$.ajax(...{
type:"POST",
url:"demoserver.php",
data:"name=John&location=Boston",
dataType:"html",
success:function(msg)...{
$("#msg").html(msg);
}
});

$("#loading").ajaxStop(function()...{
$(this).hide();
});
});
//-->
</
SCRIPT
>
<
BODY
>
<
div
id
="loading"
style
="display:none"
>
Loading......
</
div
>
<
div
id
="msg"
></
div
>
<
div
id
="error"
></
div
>
<
div
id
="sucess"
></
div
>
</
BODY
>
</
HTML
>
本文通过一个实例展示了如何使用 jQuery 库实现 AJAX 的加载和停止效果。具体包括:利用 $(#loading).ajaxStart 和 $(#loading).ajaxStop 方法控制加载提示的显示与隐藏,以及如何发送 POST 请求到服务器并获取响应。
1134

被折叠的 条评论
为什么被折叠?



