-4
如何解析JSON響應 的JSON迴應如下如何解析以下JSON響應
{ "status": "SUCCESS", "error_code": "", "message": "", "trips": [ { "trip_id": 405, "arrival_time": "26-12-2016 2:01 pm", "departure_time": "25-12-2016 9:15 am",
"available_seats": 36, "boarding_points": [ { "bp_address": "SARAI KALE KHAN", "bp_id": "1360160", "bp_name": "SARAI KALE KHAN", "bp_contact_number": "", "bp_landmark":
"SARAI KALE KHAN", "bp_location": "SARAI KALE KHAN", "bp_prime": "false", "bp_time": "25-12-2016 9:15 am"
}], "dropping_points": [ { "dp_address": "AGRA", "dp_id": "1360186", "dp_name": "AGRA CANTT RAILWAY STATION", "dp_contact_number": "", "dp_landmark": "AGRA",
"dp_location": "AGRA CANTT RAILWAY STATION", "dp_prime": "false", "dp_time": "26-12-2016 2:01 pm" } ], "cancellation_policy": [ { "from_time": "25-12-2016 8:15 am",
"to_time": "25-12-2016 9:15 am", "service_charge": "96.25", "seat_fare": 385 }, { "from_time": "24-12-2016 9:15 am", "to_time": "25-12-2016 8:15 am", "service_charge":
"57.75", "seat_fare": 385 }, { "from_time": 0, "to_time": "24-12-2016 9:15 am", "service_charge": "0.00", "seat_fare": 385 } ], "bus_type": "JAN RATH A/C(2+2)",
"fare_details": [ { "base_fare": "385.00", "other_tax": "0.00", "self_markup": "0.00", "total_fare": "385.00", "commission": 6.4295
}], "travels_name": "Uttar Pradesh State Road Transport Corporation(UPSRTC)", "operator_id": "11044", "ac": "true", "seater": "true", "sleeper": "false",
"vehicle_type": "BUS", "partial_cancellation_allowed": "false" } ] }
感謝
你嘗試過什麼到目前爲止? –
你可以使用JSON.parse –
是的,它的完成,謝謝你 – Ghanshyam