zoukankan      html  css  js  c++  java
  • jquery之ajax


            $.ajax({
                type: "get",//使用get方法访问后台
                dataType: "json",//返回json格式的数据
                url: "BackHandler.ashx",//要访问的后台地址
                data: "pageIndex=" + pageIndex,//要发送的数据
                beforeSend : function(){ },
                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");//添加到模板的容器中
           },
           error: function (XMLHttpRequest, textStatus, errorThrown) {
               // 通常 textStatus 和 errorThrown 之中
               // 只有一个会包含信息
               this; // 调用本次AJAX请求时传递的options参数
          }
      
                });

  • 相关阅读:
    雷少东_百度百科
    180China丨the Agency for Brand Engagement and Experience
    建立可信连接
    【行业干货】2013中国零售商排名
    30万左右买什么车好?_百度知道
    极速入职-拉勾网-专注互联网职业机会
    python
    关于幂律分布的一个笔记_哈克_新浪博客
    幂律分布_百度百科
    使用firefox直接 打开pdf文件可以破解禁止打印的功能
  • 原文地址:https://www.cnblogs.com/andydao/p/3049293.html
Copyright © 2011-2022 走看看