ajax请求.action

  • Post author:
  • Post category:其他


如下代码

$.ajax({




type: “GET”,



url: “newhome.action?method=accomplish”,  //请求action文件中的一个方法



dataType: “json”,



success: function(data){




console.log(data);



var html = ”;



$.each(data, function (commentIndex, comment){      //遍历返回的数据,使其动态加载到dom中。



html+='<tr><td><a href=’+’/wiapi/showTaskForm?action=showTaskFrom&instanceid=’+comment[‘pathe2’]+’&taskid=’+comment[‘pathb2’]+’&openmode=refresh>’+comment[‘topic’]+'</a></td><td>’+getMyDate(comment[‘time’])+'</td><td>’+comment[‘name’]+'</td><td><a href=’+’/wiapi/processmonitor?resid=’+comment[‘pathe2’]+’&instanceid=’+comment[‘path’]+’>’+comment[‘play’]+'</a></td></tr>’;



})



$(‘#accomplish>tbody’).html(html);



}

});



版权声明:本文为lijj_html5原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。