1. 程式人生 > >解決JSON返回的時間帶字元T的問題(前端解決辦法)

解決JSON返回的時間帶字元T的問題(前端解決辦法)

function showArticleList(id){    var myUrl = "../api/Articles";    $.ajax({        type: 'GET',        url: myUrl,        data: {            page: iIndex, rows: 13, sort: "UpdateTime", order: "desc", ChannelID: id,AuditState: 3        },        dataType:"json",        success: function (data)        {            var myHtml = "";            if (data.total == 0) {                pageTool.setTotal(data.total);                $(".Page").hide();                myHtml = "

沒有相關記錄

";                $("#article-list").html(myHtml);            }            else {                $(".Page").show();                pageTool.setTotal(Math.ceil(data.total /13));            }            $("#rows").html(data.total);            //$("#rows").html(data.rows.length);            var myHtml = "";            for (var i = 0; i < data.rows.length; i++)            {                myHtml += "";                myHtml += "
  • [" + timeFormat(data.rows[i].UpdateTime)
     + "]
  • ";
                myHtml += "
  • ";
            }            $("#article-list").html(myHtml);        },        error: function ()        {            ;        }    })}