Действительно ли там открытый исходный код альтернативен для StreamBase? [закрытый]

Есть 2 проблемы с вашим кодом

  1. Вы получаете в своем коде свойства cover и name, в то время как в вашем JSON есть image и name
  2. [ 119]

    В каждом цикле у вас будет индекс, превышающий размер списка, который вы ищете элементов (lastItems) В вашем примере переменная i может получить значение 3, когда последний индекс lastItems равно 1 (потому что размер 2). Таким образом, ваша функция успеха должна выглядеть следующим образом:

     var lastItems = data.list.slice(-2);
    
    //You remove the item (this is not necesary to put it into the each loop cause it will return one item (due to you are looking for the element that has that id), if you have more than one then you have to loop through and do something like $(this).remove();
    $("#panel .container .col-sm-6").remove();
    
    //You fill the last 2 items
    $.each(lastItems, function(i, item) {
    
    var content = '<div class="col-sm-6">';
    content += '<img class="img-responsive" src="' + lastItems[i].cover + '" alt="' + lastItems[i].name + '"/>';
    content += '<p>' + lastItems[i].name + '</p>';
    content += '</div></div>';
    $("#panel .container").append(content); //This will cause an error casue the element with the id #panel will no longer exist (it will be erased with the last remove() call
    });
    
5
задан Robert Gould 18 February 2009 в 01:38
поделиться

2 ответа

Вы могли бы изучить EsperTech: Аналитика Рядов События

5
ответ дан 14 December 2019 в 13:48
поделиться

Oracle CQL делает более или менее то же самое, что и streambase, минус интернет-интерфейс.

0
ответ дан 14 December 2019 в 13:48
поделиться
Другие вопросы по тегам:

Похожие вопросы: