I’m using router to rout from home to a inner page
{
path: '/mydetailpage/:id/',
componentUrl: '/pages/mydetailpage.html',
},
inside the page I use jQuery referencing to a specific ID to populate the page
and the side panel with links at the same page but loading different contents
<script>
return {
on: {
pageInit() {
$('#navbar-tit').html('my page');
$.getJSON("mypagejsondata.php?id=" + this.$route.params.id, function (jsondata) {
// other code
$('#page-content').html( jsondata.pagecontent );
// side panel links to other pages
sidepanel = "";
if ( !$.isEmptyObject(jsondata) ) {
if ( !$.isEmptyObject(jsondata.elements) ) {
$.each( jsondata.elements, function( k, el ) {
// sidepanel pages
var linkpath = "/mydetailpage/" + el.id +"/";
sidepanel += "<li><a href=\"" + linkpath + "\">link to page " + el.id + "</a></li>";
});
$('#sidepanel-pagelist').html( sidepanel );
}
}
});
},
}
}
the problem is that I see old page swipe to the left and a blank new page coming
what seems to happen is old page been update, because DOM keeps the old page for back ( i guess )
and new page not been populated
I guess the possible solution are:
- update page when I click on a side panel voice without changing page bunt not sure if is possible and how to do it
- disable cache for this page, not sure if possible and how to do it