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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:56:00+00:00 2026-05-30T04:56:00+00:00

I am working on a basic page with jquery-mobile. I currently have 2 pages

  • 0

I am working on a basic page with jquery-mobile.

I currently have 2 pages of data.
HOME = ListView of names
DETAILS = Details of the name

When I first open the page (home), it loads good, and shows a few names.
I click on the FIRST name, (ie: John), and it shows the details for John.
When I click BACK, and click on a NEW NAME, (ie: JANE), it doesn’t show anything.

But if I click back to JOHN, it will show his information. I’m not sure what is causing this to NOT load the second time around, perhaps caching?
Any thoughts would be helpful.

HOME PAGE

Home

    <div data-role="content">
         <ul id="homeList" data-role="listview"></ul>
    </div>
</div>

DETAILS PAGE

<div id="detailsPage" data-role="page" >
    <div data-role="header" data-position="fixed"><h1>Details</h1></div>

    <div data-role="content">
        <ul id="details" data-role="listview"></ul>
    </div>
</div>

</body>

This is my Javascript for the DETAILS Page

/* JQUERY
-------------------------------------------------------------------- */
$("#detailsPage").live('pageshow', function(event){

    var serviceToLoad = "details.php";
    var pageId        = "#detailsPage";
    var contentId     = "#details";

    // getId from global.js function
    var id = getUrlVars()["id"];

    // Apply the content to the page
    getDetails(contentId, id);
});


/* FUNCTION SET
-------------------------------------------------------------------- */
function getDetails(contentId, id) {

    // Load the JSON
    $.getJSON(serviceUrl + 'details.php?id='+id, function(data) {

        // Remove all content first
        $(contentId + ' li').remove();

        // We only need to grab the 1 result
        var details = data.items[0];
        $(contentId).append('<li><a href="#">' + details.name + '</a></li>\n');

        // Refresh page
        $(contentId).listview('refresh', true);

    });
}

Any direction would be greatly appreciated, the jQuery-Mobile is very new to me, but looks interesting!

UPDATE:
This is my current working ‘location’.
http://apps.stickystudios.ca/www/

  • 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-05-30T04:56:01+00:00Added an answer on May 30, 2026 at 4:56 am

    If your details page is in a separate document from your home page then you can use the options object of $.mobile.changePage() to allow the page to be refreshed each time it’s visited:

    $(document).delegate('#home', 'pageinit', function () {
        $('#homeList').find('a').bind('click', function () {
            $.mobile.changePage(this.href, {
                reloadPage : true
            });
            return false;
        });
    });
    

    Docs for $.mobile.changePage(): http://jquerymobile.com/demos/1.0.1/docs/api/methods.html

    Update

    I added this code to your page via my developer console:

    $(document).delegate('#detailsPage', 'pagehide', function () { $(this).remove(); });
    

    Which removes the #detailsPage pseudo-page every-time it’s navigated away from. The problem you were having was that there were multiple #detailsPage elements in the DOM which causes errors.

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

Sidebar

Related Questions

jQuery return links are not working. I have Used jQuery and the basic Ajax
I am new to JQuery UI and I have gotten the basic example working
I'm working on a home page which has a basic image fader: <div id=cycle>
Here's the basic layout of a page I'm working on: alt text http://www.mfrl.org/images/pagelayout.png What
I have a service, as follows: The most basic (working) CherryPy 3.1 Windows service
I'm working on a very basic shopping cart system. I have a table items
I am working on a basic HTML page that requires the user to send
Need basic help using JQuery and AJax. I have an ul <div id=topics> <h1><a
I have a fairly basic dialog maker for jquery that works in 2 out
I have a basic page, with a div containing text, and a form to

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.