zoukankan      html  css  js  c++  java
  • 获取json同时在客户端格式化DateTime

    asp.net获取json  datetime 会是一个很纠结的格式 下面是格式好的方法 纯属笔记 希望也大家有帮助

    $.ajax({

                            type: "POST",
                            url: "/Notify.mvc/Get",
                            data: "",
                            contentType: "application/json; charset=utf-8",
                            dataType: "json",
                            dataFilter: function(data, type) {
                                return data.replace(/"\\\/(Date\([0-9-]+\))\\\/"/gi, 'new $1');
                            },
                            success: function(n) {
                                if (n != "False") {
                                    $("#notify").text(decodeURI(n.NotifyTopic));
                                }


                            }
                        }

                       );
  • 相关阅读:
    牛客小白月赛29 种树 题解(思维)
    E
    D
    方格取数(number) 题解(dp)
    csust T1097 “是时候表演真正的技术了” 题解(虚点跑最短路)
    poj 2352 Stars
    poj 3321 Apple Tree
    poj 3067 Japan
    poj 1195 Mobile phones
    poj 2155 Matrix
  • 原文地址:https://www.cnblogs.com/chenxianbin89/p/1786621.html
Copyright © 2011-2022 走看看