[PhoneGap开发] 如何强制刷新jqueryMobile的内联页面(Internal Page)

jqueryMobile内联页面(Internal Page)强制刷新的代码如下:

$.mobile.changePage(pageurl, {
    'allowSamePageTransition' : true,
    'reloadPage' : true,
    'transition' : 'none'
});

代码解读:

  • pageurl: 指向当前页面的页面id或者路径
  • allowSamePageTransition:默认情况下,changPage函数会自动忽略与当前页面相同的页面更改请求。将此标志设置为true,使其不能忽略页面更改请求。
  • reloadPage:设置为true时,可令页面Dom重新装载,可触发一系列构造过程。
  • transition:因为打开 allowSamePageTransition 时,会带来 transition 动画的问题(某些 transition 是假设新旧页面是不同),所以将transition设置为none避开这个问题。

猜你喜欢

转载自nswish.iteye.com/blog/1628777
今日推荐