ajax请求

 

function getList(obj){
  jQuery.post(contextPath+"cc/cc.action",{type:obj},function(data){
    var html = '';
    if(data != "0"){
      var list = $.parseJSON(data);
      jQuery.each(list, function(n, info){
        info.index = n + 1;
        html += juicer($('#cc_tpl').html(), info);
      })
    }else{
      html = '<li class="clearfix" style="width:100%"><span style="color:red;">暂无数据</span></li>';
    }
    $('#ccUl').empty().html(html);
  },'json');
}

 

jQuery.ajax({
  type:'POST',
  url:'index.php?app=Group&mod=Group&act=getGroupList',
  data:postArgs,
  beforeSend:function(){//发送ajax请求前加载信息提示
  $('#searchList').html ('正在加载中...... 请稍后');
  },
  success:function(msg){
  jQuery('#searchList').html(msg);
  },
  error:function(msg){
  }
});

 

posted @ 2017-01-19 15:19  槿栀  阅读(111)  评论(0)    收藏  举报