Sometimes its necessary to refresh the current page in Phonegap app. There are basically two ways to refresh currently executing page
- window.location.reload();
- window.location = "filename.html";
In case you are using JQuery Mobile and you want to refresh the current page(i.e., current view) then use this code
jQuery.mobile.changePage(window.location.href, {
allowSamePageTransition: true,
transition: 'none',
reloadPage: true
});
allowSamePageTransition: true,
transition: 'none',
reloadPage: true
});
Remember that refreshing a page removes all dynamically added content of the page.