Parse Json data in Jquery

前端 未结 4 1596
心在旅途
心在旅途 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:30

    Try this code.

    $.ajax({
        /* type : "POST", */
        url: "launchapptest",
        /* contentType: "application/json; charset=utf-8", */
        data: "processDateInput=" + processDate,
        dataType: "json",
        async: true,
        success: function (result) {
            var od = JSON.stringify(result);
            var obj = JSON.parse(od);
    
            $.each(obj, function (index, value) {
                console.log(obj[index][0].percentageCompleted);
                console.log(obj[index][0].processRunning);
                console.log(obj[index][0].remainingTime);
                console.log(obj[index][0].successBatchCount);
                console.log(obj[index][0].totalBatchCount);
                console.log(obj.processDateInput);
                $.each(obj[index][0].dateProcessed, function (ind, val) {
                    console.log(val);
                })
            });
    
        }
    });
    

提交回复
热议问题