Does it support append items from ajax call result? If yes how i suppose to fix the error #441
-
//function to get ajax data for append //error |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use wait and ready and append at success timing. ig.on("requestAppend", (e) => {
e.wait();
const nextGroupKey = (e.groupKey || 0) 1;
$.ajax({
type: "GET",
url: route,
cache: false,
data: {page : nextGroupKey},
success: function (result) {
var data;
if (typeof(result) === 'string') {
data = JSON.parse(result);
} else {
data = result;
}
for (let i = 0; i < data['posts'].length; i) {
nextItems.push(<div class="item"></div>);
}
e.ready();
ig.append(getItems(nextGroupKey), nextGroupKey); });
},
});
|
Beta Was this translation helpful? Give feedback.
@yuhkeonggoh
You can use wait and ready and append at success timing.