Answer the question
In order to leave comments, you need to log in
How to categorize json using jQuery?
All with the coming! I have a category id in json, for example "id":"5". and I need to scatter over blocks with id="1", id="2", id="3", id="4", id="5" and so on. Please help me how to do this
Answer the question
In order to leave comments, you need to log in
Hey!
Minor block edits. The element cannot be with a numeric-only ID , you must add a letter.
For example:
According to the script, everything is simple: We go over the received data, and look for the element corresponding to it by id
var data = { "channels": [...] };
$.each(data, function(idx, el){
var id = el.id,
$curEl = $('#b' + id);
//в зависимости от того, как именно надо раскидать данные, выводим в элемент
$curEl.append(ДАННЫЕ);
//или
$curEl.html(ДАННЫЕ);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question