• 五、数据格式


    一、Json

    匿名Json

     return new { Code = "200", Message = "json创建成功" }; //匿名Json
    

      

    Json数组

    /* var Billcators = [
         { name: '学习动机', max: 50 },
         { name: '社会适用', max: 50 },
         { name: '人际交往', max: 50 }
         
     ];*/
    

      

    注:没有数组Json,仅仅是外层嵌入多层json,最后是外层{},还是[]在外层的。

    多维json

    {
    	"zl": {
    		"CaseId": "d7eeef89-81e3-4edf-b0c8-e2bde8307f6a",
    		"DivisionId": "310101021",
    		"Address": "黄浦区打浦路38弄",
    		"UnitPrice": "75904",
    		"TotalPrice": "1593984",
    		"QueryDate": "2019/5/27 12:07:54",
    		"AvgUnitPrice": "75904",
    		"AvgPrice": "75904",
    		"MaxPrice": "79487",
    		"MinPrice": "72034",
    		"MangerPrice": "3.5",
    		"Liveness": "1",
    		"TotalCellNumber": "972",
    		"QueryCount": "11",
    		"ReturnCode": "1",
    		"Remark": "估价成功",
    		"EndDate": "1994/01/01 0:00:00",
    		"ConstructionName": "打浦路38弄",
    		"ConstructionAlias": "海华花园|",
    		"BuildingName": "",
    		"HouseName": "",
    		"PropertyType": "",
    		"QuotationCount": "6"
    	}
    }
    

      

                    var strjson = "{"zl":{"CaseId":"d1165263-4c60-4d50-84f8-c259e7e05548","DivisionId":"310101021","Address":"黄浦区打浦路38弄","UnitPrice":"75904","TotalPrice":"3036160","QueryDate":"2019/5/27 13:19:48","AvgUnitPrice":"75904","AvgPrice":"75904","MaxPrice":"79487","MinPrice":"72034","MangerPrice":"3.5","Liveness":"1","TotalCellNumber":"972","QueryCount":"11","ReturnCode":"1","Remark":"估价成功","EndDate":"1994/01/01 0:00:00","ConstructionName":"打浦路38弄","ConstructionAlias":"海华花园|","BuildingName":"","HouseName":"","PropertyType":"","QuotationCount":"6"}}";
                    var objjson = JSON.parse(strjson);
                    console.log("sss=" + JSON.stringify(objjson.zl));

    一、前端枚举

    "[{"HouseArea":"11132","OneMortgage":"","OneCertificate":"","OneSquare":"1123","OneTimeValue":"","OneEvalValue":"","Mortgage":"1113","Certificate":"1132","TimeValue":"111132","EvalValue":"113"},{"HouseArea":"12223","OneMortgage":"","OneCertificate":"","OneSquare":"22232","OneTimeValue":"","OneEvalValue":"","Mortgage":"22232","Certificate":"22232","TimeValue":"223","EvalValue":"223"}]"
    

      转对象遍历方式

     

    一、前端枚举

        //var o = {
        //    0: "住宅"
        //    , 1: "公寓"
        //    , 2: "别墅"
        //};
    
        //var b = {
        //    0: "南"
        //    , 1: "西"
        //    , 2: "东"
        //    , 3: "北"
        //    , 4: "东南"
        //    , 5: "东北"
        //    , 6: "东西"
        //    , 7: "南北"
        //    , 8: "西南"
        //    , 9: "西北"
        //};
    

      替换

        var oo={};
        var bb={};
        $.each(o,function(_key)
        {
            var key = _key;
            var value = o[_key];  
            console.log("key:"+key+"|value:"+value);
            oo[value]=key;
    
        });
        console.log("00"+oo);
        $.each(b,function(_key)
        {   
            var key = _key;
            var value = b[_key];  
            bb[value]=key;
        });
    

      

      

    一、WebApi

    二、MVC

  • 相关阅读:
    基于Freescale的主流芯片HCS08
    BizTalk Server 2010 映射器(Mapper) [ 下篇 ]
    BizTalk Server 2010 使用 WCF Service [ 中篇 ]
    Ext JS 4 Beta 1发布了
    Step by Step WebMatrix网站开发之一:Webmatrix安装
    REST WebService与SOAP WebService的比较
    BizTalk Server 2010 使用 WCF Service [ 上篇 ]
    BizTalk Server 2010 映射器(Mapper) [ 中篇 ]
    BizTalk Server 2010 映射器(Mapper) [ 上篇 ]
    ExtJS 4 Beta 2预览:Ext.Brew包
  • 原文地址:https://www.cnblogs.com/fger/p/10836291.html
Copyright © 2020-2023  润新知