I'm calling some JSON (cut short for size reason);
"numExecutors" : 2,
"description" : null,
"jobs" : [
{
"name" : "Test",
"url" : "http://www.carlbruiners.com/job/Test/",
"color" : "blue"
},
{
"name" : "Test 2",
"url" : "http://www.carlbruiners.com/job/Test%202/",
"color" : "blue"
}
]
I need to be able to get at the jobs.name field, but I've tried various loops but I can't get it to work. My Jquery code is;
function getJobs() {
$.jsonp({
"url": jenkins_url + "/api/json?jsonp=jsoncallback=?",
"data": {
"alt": "json-in-script"
},
"success": function(data) {
//alert('Sucess');
for(var key in data) {
var value = data[key];
//alert(value);
}
},
"error": function(e) {
alert('Failed ' + e);
}
});
}