日期:2014-05-16  浏览次数:20748 次

jquery_使用ajax提交请求返回处理数据
   var url = "/ssm/modules/getAllModules.action";
   var params={"tm":Math.random()};
  
   jQuery.ajax({
    type: "get",                      
    contentType: "application/json",                    
    url: url,
    data: params,                   
    dataType: 'script',               
   
    success: function(data) {
                       var items = APRS.result;
                       var strtemp = [];
                       for(var i=0;i<items.length;i++){
                          strtemp.push('<li>'+(i+1)+'. ');
                          strtemp.push('<input type="checkbox" name="modules"  value="'+items[i].id+'"/>');
                          strtemp.push(items[i].name);
                          strtemp.push('</li>');
                       }
                       $("#moduleList").html(strtemp.join(''));
     },
    error:function(data){
       alert("error");
    }
    });