how to refresh(reload) page when click button in Jquery mobile

徘徊边缘 提交于 2019-12-13 02:12:47

问题


I'm using Jquery mobile v1.4, how to refresh(reload) page when click button ?

Also which one is loads faster between refresh/reload ?

<a href='#' class='btnRefresh'>Refresh</a>

回答1:


You can try some thing like this

Call the given JS function on click of your anchor tag

function refreshPage() {
  $.mobile.changePage(
    window.location.href,
    {
      allowSamePageTransition : true,
      transition              : 'none',
      showLoadMsg             : false,
      reloadPage              : true
    }
  );
}

for more detail click here

I hope this helps you!




回答2:


try to use this JavaScript function location.reload();



来源:https://stackoverflow.com/questions/23559015/how-to-refreshreload-page-when-click-button-in-jquery-mobile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!