最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery Mobile refresh page after changePage - Stack Overflow

programmeradmin3浏览0评论

Is there anyway to force a jQm page to reload once changePage is plete?

I have a number of pages dynamically loaded into an array. All of the pages that are being loaded are a part of a list, for example "20 mobile apps of 2011". Users will need to have the ability to swipe left and right to navigate the pages.

I've added the current code here: /

Notice how the URL's are being pulled from the array. From this i'm able to pull the next URL and the previous URL but I am only able to navigate one page forward and one back.

You can test the page here by clicking then swiping the mouse left or right: .php

Any ideas on how to get the URL's to refresh while maintaining the native JQM transitions.

Is there anyway to force a jQm page to reload once changePage is plete?

I have a number of pages dynamically loaded into an array. All of the pages that are being loaded are a part of a list, for example "20 mobile apps of 2011". Users will need to have the ability to swipe left and right to navigate the pages.

I've added the current code here: http://jsfiddle/cncpts/qMe6Z/2/

Notice how the URL's are being pulled from the array. From this i'm able to pull the next URL and the previous URL but I am only able to navigate one page forward and one back.

You can test the page here by clicking then swiping the mouse left or right: http://www.cncpts.me/plex/swipe/index.php

Any ideas on how to get the URL's to refresh while maintaining the native JQM transitions.

Share Improve this question asked May 14, 2012 at 16:46 HjalmarCarlsonHjalmarCarlson 8782 gold badges17 silver badges34 bronze badges 2
  • Do you mean you want to refresh pages the second time you view them? Or do you mean that you want to refresh pages are not currently being viewed? – Jasper Commented May 14, 2012 at 17:10
  • I guess I don't need the browsers URL to change, i'm already doing this using the HTML5 history API. I need to update the URL's for next & previous. If you got to index2.php then swipe left, you'll get index3.php then try to swipe back you should get index2 but you get index.php. So it's storing the original page values, not new ones. – HjalmarCarlson Commented May 14, 2012 at 17:26
Add a ment  | 

1 Answer 1

Reset to default 0

Why don't you use the JQM pagaintion plugin? Should be exactly what you are looking for.

If you want to change the URL you will have to set the changehash option to true in order for it to change

 $.mobile.changePage(next,{
      changeHash:true,
      reloadPage:true,
      dataUrl:next
      });

Here is the link to the demo

发布评论

评论列表(0)

  1. 暂无评论