The page feed.html works fine when its called from browser but when it is called from another page via a href="feed.html"
page loads but the listview inside doesn't show up.
The script that works for feed.html contains $('#feedList').listview('refresh');
and it works fine when its calling from direct url.
So each time i need to refresh the page after redirection to work.
getfeed.js :
var newsfeeds;
$('#feedListPage').bind('pageinit', function(event) {
getFeedList();
});
function getFeedList() {
$.getJSON(serviceURL + 'getfeeds.php', function(data) {
$('#feedList li').remove();
newsfeeds = data.items;
$.each(newsfeeds, function(index, newsfeed) {
$('#feedList').append('<li><a href="feeddetails.html?id=' + newsfeed.id + '">' +
'<img src="' + newsfeed.img + '"/>' +
'<h4>' + newsfeed.title + '</h4>' +
'<p>' + newsfeed.desc + '</p>' +
'</a></li>');
});
$('#feedList').listview('refresh');
});
}
This code alone works fine but when its called from another page it does not refresh the list.