简体   繁体   中英

Use cached pages with Ratchet (Push.js)

I'm developing an hybrid app and I'm using Ratchet for that. On the first page (index.html) the app retrieves content dynamically and adds that content via jQuery to the DOM. When I navigate to another tab (sub-page), and navigate back to the main page (index.html), everything is gone.

How can I navigate (or use) the cached page of the main page?

Ratchet relies upon an MPA (multiple page architecture) while you need a SPA (single pa): you can change your framework OR have a workaround (ie: you can first cache data in a JSON using localStorage and then retrieve them in the showing pages).

PS: I warmly suggest you to rely on a SPA-oriented framework, to keep it simple and efficient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM