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 8462249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:06:54+00:00 2026-06-10T14:06:54+00:00

I have a multi-page template set up. The first page has a set of

  • 0

I have a multi-page template set up. The first page has a set of links to the inner pages – however all but one link to the same #template page which loads data dynamically. The other link is to a form which I have built within the page.

Problem I’m having is when you navigate to one of the links, continue through the pages and then use the back button to get back to the first page, if you then click the link to the form it doesn’t navigate to the #page, it goes to the last page you were on in the other links.

Hope that makes sense – maybe a diagram will make it clearer

home > product list > product detail

product detail > product list > home (back button)

home > contact form

This last step shows the product detail page again, instead of the contact form. It’s as if it’s not clearing the page out:

My code (truncated for clarity):

<script type="text/javascript">
    $(document).bind("mobileinit", function () {
        $.mobile.allowCrossDomainPages = true;
        $.support.cors = true;
    });

    $(document).delegate("#pageDetail", "pagecreate", function () {
        $(this).css('background', '#ECF2FE');//`this` refers to `#pageDetail`
    });

    $(document).bind("pagebeforechange", function (e, data) {           
        // We only want to handle changePage() calls where the caller is
        // asking us to load a page by URL.         

        if (typeof data.toPage === "string") {
            $.mobile.pageData = (data && data.options && data.options.pageData) ? data.options.pageData : null;
            // We are being asked to load a page by URL, but we only
            // want to handle URLs that request the data for a specific
            // category.

            var page;
            var type;
            var cat;
            if ($.mobile.pageData && $.mobile.pageData.type) {
                type = $.mobile.pageData.type;
            }

            if ($.mobile.pageData && $.mobile.pageData.cat) {
                cat = $.mobile.pageData.cat;
            }

            if ($.mobile.pageData && $.mobile.pageData.page) {
                page = $.mobile.pageData.page;
            }

            var url = $.url(data.toPage);   //  page url
            var hash = url.fsegment(1).replace(/&.*/, "");  //  nav hash for page holder            

            switch (hash) {
                case "pageList":
                    $.ajax({
                        url: "http://localhost/myapp/" + type + ".aspx?type=" + type,
                        datatype: "html",
                        success: function (data) {
                            $('.submenu').html(data);
                            $('.title').html(type);
                            $('.submenu').trigger('create');
                        }
                    });
                    break;
                case "pageDetail":
                    $('.detail').load('http://localhost/myapp/' + type + '.aspx?page=' + page + '&type=' + type + ' #contentdiv', function () {
                        $(this).trigger('create');
                    });
                    break;
                default:
                    break;
            }
        }
    });
</script>
</head>

HTML bits

<body>
<div data-role="page" id="home">
    <div data-role="content">
        <a href="#pageList?type=products" data-transition="slide"><img src="images/Icon-Courses.png" alt="courses" /></a><br />
        <a href="#contactForm" data-transition="slide"><img src="images/Icon-Contact.png" alt="contact" /></a>              
    </div>
</div>

<div data-role="page" data-theme="a" id="pageList" data-add-back-btn="true" style="background-color:#F0F0F0 !important;">
    <div data-role="header" data-position="fixed">          
        <h1 class="title">Products</h1>      
    </div>
    <div data-role="content" class="submenu">   
        <!-- content gets put in here -->
    </div>

</div>

<div data-role="page" data-theme="a" id="pageDetail" data-add-back-btn="true" style="background-color:#F0F0F0 !important;">
    <div data-role="header" data-position="fixed">          
        <h1 class="title">Products</h1>      
    </div>
    <div data-role="content" class="submenu">   
        <!-- content gets put in here -->
    </div>

</div>


<div data-role="page" data-theme="a" id="contactForm" data-add-back-btn="true" class="detailpage" style="background-color:#F0F0F0 !important;">
    <div data-role="header" data-position="fixed">          
        <h1 class="title">Contact Us</h1>
    </div>
    <div data-role="content" class="detail">
        <div id="contentdiv" style="margin:10px auto;width:90%;">
        <label for="name">Your Name</label>
            <input type="text" id="name" style="width:90%;" data-mini="true" />
            <label for="email">Email Address</label>
            <input type="text" id="email" style="width:90%;" data-mini="true" />
            <label for="phone">Phone Number</label>
            <input type="text" id="phone" style="width:90%;" data-mini="true" />
            <label for="comments">Enquiry / Comments</label>
            <textarea id="comments" rows="80" style="width:90%;" data-mini="true"></textarea>
            <br />
            <input type="submit" id="submit" value="Send Enquiry Now" />                
        </div>
    </div>

</div>

</body>
</html>

I’m using the jqm.page.params.js for handling the querystring parameters.

Is there anything obvious there? The links to the #pageDetail page are returned within the content shown on #pageList.

Don’t understand why I can’t seem to clear the cache and it doesn’t navigate correctly to the contact form if you’ve been anywhere else first. if you go straight there it works fine.

Anyone shed any light? BTW this needs to work using PhoneGap as a standalone

Thanks

  • 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-10T14:06:55+00:00Added an answer on June 10, 2026 at 2:06 pm

    Actually feel a bit dim about this, but it’s because I had the same class names on multiple divs and it was using those to import data – so when it was loading data remotely it was putting it in more than one place, overwriting the form at the same time…

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

Sidebar

Related Questions

I have a program which prints a multi-page document. The first page is pre-printed
I have a single page template page ( page1.aspx ) which loads a multi-page
i have multi pages pdf,i want to go to the next page of pdf,
I have a multi-page PDF file that has information I need to parse. The
I have multi-language website in Drupal, but not all content is translated. I want
Our intranet site has an unusual set of requirements. It functions like a multi-page
I have a multi-page template setup. My home screen background color is different from
I have a multi page template developed in jquery mobile.The problem I am facing
I have a multi-page form, aka a Wizard pattern, where Page 1 corresponds to
I have a multi-lingual page where I want to display form validation error in

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.