您的位置:时时彩走势图 > 重庆时时五星彩走势图-服务器运维 > JQuery 获取json数据$.getJSON方法的实例代码_jquery_脚

JQuery 获取json数据$.getJSON方法的实例代码_jquery_脚

2020-04-15 16:03

前台:复制代码 代码如下:function SelectProject() { var a = new Array; var r = window.showModalDialog('SelProject.aspx', a, "dialogWidth=1000px; dialogHeight=600px; resizable: yes"); if != 'undefined') { var arr = r.split; $.val; $.val; $.getJSON("../Handler/GetProjectInfor.ashx", { key: "PaymentStatement", InnerID: $.val { $.text; $.text; var strDeviceTr = ""; $.each(json.workinghours, function { strDeviceTr += "

" + item.description + "

"; strDeviceTr += "

"; strDeviceTr += "

" + item.hoursdays + "

"; strDeviceTr += "

0.8

"; strDeviceTr += "

" + item.workinghour + "

"; strDeviceTr += "

0.8

"; strDeviceTr += "

" + item.workinghour + "

"; strDeviceTr += "

"; strDeviceTr += "

"; }); $.append; } }ashx复制代码 代码如下:string innerid = CommonClass.Request.GetRequest; string key = CommonClass.Request.GetRequest; string result = ""; if (key == "StockOutApp" && innerid != "") { result = StockOutApp; context.Response.Write; } else if (key == "PaymentStatement" && innerid != "") { result = PaymentStatement; context.Response.Write; }#region 结算单信息 public string PaymentStatement { try { string sql = @"select InnerID,pFinalClient,pOrderNo from se_ProjectMain where InnerID='" + _innerid + "'"; DataTable dt = SqlShift.GetDataTable; if (!CommonClass.DTRow.CheckDtIsEmpty { StringBuilder json = new StringBuilder(); json.Append(""innerid":""+dt.Rows[0]["InnerID"].ToString; json.Append(","finalclient":"" + dt.Rows[0]["pFinalClient"].ToString; json.Append(","orderno":"" + dt.Rows[0]["pOrderNo"].ToString; json.Append(","workinghours":" + GetWorkingHours; return "{" + json.ToString + "}"; } else { return string.Empty; } } catch { AppLog.Write("项目获取异常![异常信息:" + ex.Message + "]", AppLog.LogMessageType.Info); return string.Empty; } } public string GetWorkingHours { try { string sql = @"select InnerID, wDescription,wWorkingHour,wHours_Days from se_ProjectWorkingHour where wProjectID='" + _innerid + "'"; DataTable dt = SqlShift.GetDataTable; if (!CommonClass.DTRow.CheckDtIsEmpty { StringBuilder json = new StringBuilder(); for (int i = 0; i < dt.Rows.Count; i++) { json.Append; json.Append(""innerid":"" + dt.Rows[0]["InnerID"].ToString; json.Append(","description":"" + dt.Rows[0]["wDescription"].ToString; json.Append(","workinghour":""

  • dt.Rows[0]["wWorkingHour"].ToString; json.Append(","hoursdays":""
  • dt.Rows[0]["wHours_Days"].ToString; json.Append; } return "[" + json.ToString + "]"; } else { return string.Empty; } } catch { AppLog.Write("项目获取异常![异常信息:" + ex.Message + "]", AppLog.LogMessageType.Info); return string.Empty; } } #endregion

本文由时时彩走势图发布于重庆时时五星彩走势图-服务器运维,转载请注明出处:JQuery 获取json数据$.getJSON方法的实例代码_jquery_脚

关键词: