Possible Duplicate:
Javascript hard refresh of current page
Is there a way to refresh a page using javascript? I’m using jQuery Mobile to display some statistics in a listview (probably a listview), and I need to re-populate the data from a MySQL db every 10 seconds, let’s say. Is this possible?
Thanks in advance.
If you’re using JQM use the listview.(‘refresh’) method on a list view. Use ajax and call .refresh() on the list in the handler.
FROM JQM Docs:
http://jquerymobile.com/test/docs/lists/docs-lists.html
Updating lists
If you add items to a listview, you’ll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example:
$(‘#mylist’).listview(‘refresh’);
Note that the refresh() method only affects new nodes appended to a list. This is done for performance reasons. Any list items already enhanced will be ignored by the refresh process. This means that if you change the contents or attributes on an already enhanced list item, these won’t be reflected. If you want a list item to be updated, replace it with fresh markup before calling refresh.