getJSON - Outputting JSON data object with jQuery

0 votes
231 views
added Aug 1, 2019 in API by LC Marshal Captain (25,790 points)
var apiData = "http://dummy.restapiexample.com/api/v1/employees";         
$.getJSON(apiData, function (data) {
    $.each(data, function (key, jsonObject) {
        console.log(jsonObject.id, jsonObject.employee_name)
        // if (jsonObject.key == "INFO") {
        // }
    })
});

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...