D
D
Dc8882015-09-11 01:41:35
JavaScript
Dc888, 2015-09-11 01:41:35

Json data output in html adding class and id's for decoration, how?

hello, here's the thing:
I'm loading data via json + ajax, but melons are displayed without decoration
, here's a piece of code:



if (data.length > 0) {
$.each(data, function(index, data){
$('#new-post').append('' + data.user_name + '. ' + data.news_subject + ' ');
});
inProcess = false;
row+= 5;
}

when you try to add a style to the code, everything collapses and the download does not work, what should I do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dc888, 2015-09-11
@Dc888

here is the full script, it is integrated into the page as php. rather than html, those are taken in <? ?>
jsfiddle.net/pxr4nshv
and it turns out it works, but if you add a style to the element, those class='', it stops working

S
Stalker_RED, 2015-09-11
@Stalker_RED

What exactly is broken for you? jsfiddle.net/tfxkmx8p

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question