Parse Json data in Jquery

前端 未结 4 1598
心在旅途
心在旅途 2020-12-07 02:30

I am new to Jquery, Ajax and JSON. I am facing issue with the parsing of Json data. I have been through many questions on stackoverflow

Parsing JSON objects for HTML

4条回答
  •  悲&欢浪女
    2020-12-07 03:35

    What is the is the return data of your AJAX call

    is like this then

    {
        "od": [
            {
                "dateProcessed": [
                    "09/11/2014",
                    "09/12/2014"
                ],
                "percentageCompleted": 25,
                "processRunning": 0,
                "successBatchCount": 0,
                "totalBatchCount": 0
            }
        ],
        "processDateInput": "12/11/2014"
    }
    

    you can parse it like this

    var json = JSON.parse(result);
                var od = json['od'];
                var processDateInput = json['processDateInput'];
    
                $.each(od, function(index, value){
                    console.log(value, index);
                });
    

    hope it would work on you.

提交回复
热议问题