Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:38:45+00:00 2026-06-07T07:38:45+00:00

According to the jQuery docs calling pageContainerElement.page({ domCache: true }); will cache a particular

  • 0

According to the jQuery docs calling

pageContainerElement.page({ domCache: true });

will cache a particular page programmatically. However, as correctly pointed out by this github issue, this will not work if called after the pagecreate event.

From the main page of my app a user can get to another page where there is a form that they can put information into. On this form is a button for a modal popup that the user can select certain tags from. When this modal closes and the user is returned to the form, it is reset because the page has been removed and re-added.

One thing I can do is cache the page with the form so the data isn’t cleared. The only way to do this programmatically is

function cachePage() { $('#tags').closest('div[data-role=page]').page({ domCache: true }); }
$(document).on('pagebeforecreate', cachePage);

assuming #tags is only an element on the page I’d like to cache. However, I now cannot uncache the page and have it get cleaned up by jQM.

I’m wondering if I’m approaching this problem correctly, and if so, how to handle this page caching and disabling. If I’m not handling it correctly, how can I get it so that my form is preserved and I can still get information to the form from a modal popup or additional page?

Edit

One thing I recently discovered is that jQM will keep one ‘root’ page in the DOM followed by whatever other pages it loads on the surface. If I add data-ajax='false' to all links that go to forms, they should be safe to use with any modals that are called on them. Furthermore, submissions on them can be done with the same data-ajax='false' to redirect to another page without the title bar’s back button returning to the form.

Is this a better approach than either caching the form page or storing the form data in JavaScript and repopulating the form when it is loaded?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:38:47+00:00Added an answer on June 7, 2026 at 7:38 am

    If you have a pseudo-page that you know you want to persist in the DOM, add the data-dom-cache="true" attribute to the pseudo-page element. Docs: http://jquerymobile.com/demos/1.1.0/docs/pages/page-cache.html

    If you want to remove a pseudo-page in the DOM that has been cached, use .remove():

    $('#some-page').remove();
    

    In addition to the elements themselves, all bound events and jQuery
    data associated with the elements are removed. To remove the elements
    without removing data and events, use .detach() instead.

    Source: http://api.jquery.com/remove/

    Once you remove the pseudo-page from the DOM, jQuery Mobile won’t be able to find it and will grab a new version from the external document the next time you navigate to the pseudo-page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the docs, jQuery.extend() is a solution to execute both a deep and
According to the jQuery docs, I need to escape metacharacters that occur in my
I have set up JQuery UI autocomplete according to the docs and it works
According to http://docs.jquery.com/Plugins/Validation the form tag is necessary in order to do validation. In
Using jQuery Autocomplete, according to the docs you have to do the following to
So according to the jQuery Ajax docs , it serializes data in the form
According to the documentation in http://docs.jquery.com/UI/Menu#event-select the following should fire an event when selecting
I've built a custom HTML5 audio player using jQUery according to the guide found
According to convention, I'm importing an initializing JavaScript file into my jQuery Mobile pages
I am using JQuery Accordion. I have this page here: http://www.hauppauge.com/site/support/support_colossus.html#tabs-6 What happens is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.