核心提示:ajax请求.action:希望下面的文章对大家有所帮助。如下代码$.ajax({type: GET,url: newhome.action?method=accomplish, //请求action...
ajax请求.action:希望下面的文章对大家有所帮助。如下代码
$.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+=''+comment['topic']+''+getMyDate(comment['time'])+''+comment['name']+''+comment['play']+''; }) $('#accomplish>tbody').html(html); } });