jQuery Tips

1.给xmlhttp请求添加提示

 

 1 $(document).ready(function() {   
 2     $().ajaxStart(
 3         function() {
 4             if (document.getElementById('dloading'!= null) {
 5                 $('#dloading').fadeIn('fast');
 6             }
 7             else {
 8                 var dl = document.createElement('div');
 9                 dl.setAttribute('id''dloading');
10                 document.body.appendChild(dl);
11                 $('#dloading').html('数据读取中');
12             }
13         }
14     ).ajaxStop(function() {
15         $('#dloading').fadeOut('fast');
16     });
17 });

 

2.全选Checkbox

1 $(document).ready(function() {
2             $('#chkAll').click(
3              function() {
4                  $("INPUT[type='checkbox']").attr('checked', $('#chkAll').is(':checked'));
5              });
6          });    

posted on 2008-12-20 17:45  yyliuliang  阅读(342)  评论(0编辑  收藏  举报

导航