Есть вот такой вот скрипт .Как пребрать в ul li и выгрузить в каждый li по очереди масив con?
масив con
$(document).ready(function () {
var coin = ['BTC', 'LTC', 'ETH' ];
$(function() {
$('#currency-list').change(function() {
var curVal = $("#currency-list option:selected").val();
$(function() {
for (var i in coin) {
$.ajax({
url: 'https://apiv2.bitcoinaverage.com/indices/global/ticker/' + coin[i] + curVal,
async: false,
dataType: 'json',
success: function(data) {
var price = data.changes.price,
percent = data.changes.percent,
hours = $(' <span>', { class: "list-item", text: price.hour});
day = $('<span>', { class: "list-item", text: price.day}),
week = $('<span>', { class: "list-item", text: price.week}),
month = $('<span>', { class: "list-item", text: price.month}),
box = $("ul[data=" + coin[i] +"]"),
con = [hours, day, week, month];
if (coin[i] === coin[i]) {
$(document).find(box).append(con)
}
},
error: function (jqXHR, exception) {
console.log('error')
}
});
};
});
});
});
});