首頁 >web前端 >js教程 >JQuery 取得json資料$.getJSON方法的實例碼_jquery

JQuery 取得json資料$.getJSON方法的實例碼_jquery

WBOY
WBOY原創
2016-05-16 17:27:221054瀏覽

 前台:
 

複製程式碼 程式碼如下:

 function SelectProject() {
            var a = new Array;
   th=1000px;dialogHeight=600px; 可調整大小:是");
            if (typeof (r) != '未定義') {
                  $("#hidProjectInnerID").val( arr[0 ]);
                $("#txtProjectNo").val(arr[1]);
   { key: "PaymentStatement", InnerID: $ ("#hidProjectInnerID").val() },
                             $("#labFinalCustomer").text(json.finalclient);
             ).text (json.orderno);
                                 $.each(json.workinghours, function (i, item) {
               name="infor"> " item.description " ";
                                                 strDeviceTr = " " item.hoursdays "";
                         0.8";
                                                              strDeviceTr = " ;  0.8";
                                                              strDeviceTr = ";  ";
                                            });
                            $("#infor").       });
            }
        }
 
複製程式碼

程式碼如下:

 string insideid = CommonClass.Request.GetRequest("InnerID", "");
            string key = CommonClass.Request.Getquest,            string result = "";
            >                result = StockOutApp(innerid);
             );
            }
            else if (key =                result = PaymentStatement(innerid);
             ;
            }
#region 結算單資訊
        public string PaymentState     嘗試
            {
              se_ProjectMain where InnerID='" _innerid "'";
                DataTable dt = SqlShift.G  •5);                {
       StringBuilder();
                     json.Append(""innerid":"" dt.Rows            json.Append(","finalclient" :"" dt.Rows[0]["pFinalClient"].ToString() """);
                   ToString() """);
                    json.Append(","workinghours":"   return "{" json.ToString().Trim(',') "}" ;
                }
                else
                {
                     返回字符串.空;
               }
            }
            catch (異常)
            {
                AppLog.Write(" 項目獲取異常![異常訊息:" ex.Message "]", AppLog.LogMessageType.Info);
                return string.Empty 
        public string GetWorkingHours(string _innerid)
        {
            嘗試
            {
     WorkingHour、wHours_Days,其中wProjectID='" _innerid "'";
                DataTable dt = SqlShift.GetDataTable(sql);
                if (!CommonClass.DTRow.CheckDtIsEmpty(dt))
              StringBuilder json = new StringBuilder();
                , 🎜>                    {
                              json.Append(""innerid":"dt.Rows[0]["In nerID "].ToString() """);
                        json.Append(","description":"" dt.Rows   json.Append(","description":"" dt.Rows               json.Append(","工作時間":"" dt .Rows[0]["wWorkingHour"].ToString() """);
                    " "");
                        json.Append("},                     return "[" json.ToString().Trim(',') "]";
   🎜 >               else
                {
                 返回字符串.空;
                }
            }
            catch (Exception ex)
            {
                AppLog.Write("項目獲取異常![異常資訊: " ex.Message "]", AppLog.LogMessageType.Info);
                return string.Emp);
        #endregion
 
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn