ajax 跳转 填充 table 表格

版权声明:帅气Dee海绵宝宝 独家放送 https://blog.csdn.net/xyjcfucdi128/article/details/82839232

 ajax 跳转 填充表格 主要是str 进行拼接 然后append 输出到 指定id的位置 $("#ul_tysf").append(str);

// ajax 跳转 并填充 table 表格
onPageClicked: function (event, originalEvent, type, page) {

                $("#ul_tysf").html("");
                var str="";
                $.ajax({
                    url: "../content/queryPage",
                    method:"post",
                    //data:{page:page,limit:5},
                    dataType: "JSON",
                    success:function(result){
                        $.each(result.list, function (i, item) {
                            str+="<tr class='a1'>";
                            str+="<td class='td1'><h3> <a href='<%=path%>/content/content?id="+item.articleId+"'>"+item.articleTitle +"</a></h3></td>";
                            str+="<td class='td2'><h3>类别</h3></td> ";
                            str+="</tr>";
                        });
                        $("#ul_tysf").append(str);
                        //$("#tysf_pagenum").html(page+"/"+${tysf.pages});
                    }
                })

            }

猜你喜欢

转载自blog.csdn.net/xyjcfucdi128/article/details/82839232