您现在的位置:首页 >> 前端 >> 内容

ajax请求.action

时间:2017/4/10 9:22:00 点击:

  核心提示: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);

}

});

 

Tags:AJ JA AX X请 
作者:网络 来源:lijj_html5