Answer the question
In order to leave comments, you need to log in
How to get json field by key?
var json = [
{"id":"88","pagetitle":"test 88","longtitle":"","description":"описание","alias":"test/id88"},
{"id":"99","pagetitle":"test 99","longtitle":"","description":"описание","alias":"test/id99"},
{"id":"150","pagetitle":"test 150","longtitle":"","description":"описание","alias":"test/id150"},
{"id":"350","pagetitle":"test 350","longtitle":"","description":"описание","alias":"test/id350"}
]
alert(json.id[88].alias);
Answer the question
In order to leave comments, you need to log in
By key through the loop
$.each(json, function(i, object) {
if (object.id == 88) {
alert(object.alias);
return;
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question