jquery异步加载数据,jquery对table的简单操作

本文详细解析了大数据开发领域的关键技术,包括Hadoop、Spark、Flink等,并深入讨论了它们在实际应用中的优势和挑战。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<table id="datas" border="1" cellspacing="0" style="border-collapse: collapse">
                
<tr>
                    
<th>
                        订单ID
</th>
                    
<th>
                        客户ID
</th>
                    
<th>
                        雇员ID
</th>
                    
<th>
                        订购日期
</th>
                    
<th>
                        发货日期
</th>
                    
<th>
                        货主名称
</th>
                    
<th>
                        货主地址
</th>
                    
<th>
                        货主城市
</th>
                    
<th>
                        更多信息
</th>
                
</tr>
                
<tr id="template">
                    
<td id="OrderID">
                    
</td>
                    
<td id="CustomerID">
                    
</td>
                    
<td id="EmployeeID">
                    
</td>
                    
<td id="OrderDate">
                    
</td>
                    
<td id="ShippedDate">
                    
</td>
                    
<td id="ShippedName">
                    
</td>
                    
<td id="ShippedAddress">
                    
</td>
                    
<td id="ShippedCity">
                    
</td>
                    
<td id="more">
                    
</td>

                </tr>

 </table>


  $.ajax({
            type: 
"get",//使用get方法访问后台
            dataType: "json",//返回json格式的数据
            url: "BackHandler.ashx",//要访问的后台地址
           data: "pageIndex=" + pageIndex,//要发送的数据
            complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
            success: function(msg){//msg为返回的数据,在这里做数据绑定
                var data = msg.table;
                $.each(data, 
function(i, n){
                    
var row = $("#template").clone();
                    row.find(
"#OrderID").text(n.订单ID);
                    row.find(
"#CustomerID").text(n.客户ID);
                    row.find(
"#EmployeeID").text(n.雇员ID);
                    row.find(
"#OrderDate").text(ChangeDate(n.订购日期));
                    
if(n.发货日期!== undefined) row.find("#ShippedDate").text(ChangeDate(n.发货日期));
                    row.find(
"#ShippedName").text(n.货主名称);
                    row.find(
"#ShippedAddress").text(n.货主地址);
                    row.find(
"#ShippedCity").text(n.货主城市);
                    row.find(
"#more").html("<a href=OrderInfo.aspx?id=" + n.订单ID + "&pageindex="+pageIndex+">&nbsp;More</a>");                    
                    row.attr(
"id","ready");//改变绑定好数据的行的id
                    row.appendTo("#datas");//添加到模板的容器中
                }
);


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值