Having issue on .each functoin on framework7 v2

Here is my code, am getting TypeError: response.each is not a function

app.request.post(service_url+‘mm_newsfeed_fetch’, { uid:‘212154’, timestamp: 0 }, function (response) {
console.log(‘Load was performed’);
response.each(function (key, val) {
$app.dialog.alert(‘Hello world!’);
$app.dialog.alert(key);
myApp.formStoreData(‘feed_timestamp’, val.timestamp);
$$(’#feedTab .mmContent’).append(T7status_template(val));
});
});

Response returned by POST request is a string, you probably need to do JSON.parse(response) before iterate over it

1 Like

Thanks. Its working now.