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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:40:03+00:00 2026-06-11T03:40:03+00:00

I have a mobile app which I’m building up with PhoneGap and jQuery Mobile.

  • 0

I have a mobile app which I’m building up with PhoneGap and jQuery Mobile. The app fetches dynamic content from SQLite database when the user clicks the link. The data is formatted with jQM’s collapsible sets (accordions). Here’s the code.

The menu from which the user navigates to proper page:

<!-- data-role="page" id="mainmenu" -->
<ul data-role="listview" data-theme="c">
  <li><a id="news_link" href="#"> News</a></li>
  <li><a id="news_link" href="#"> Jokes</a></li>
  <li><a id="news_link" href="#"> Rumours</a></li>
</ul>

<!-- data-role="page" id="mainmenu" -->
<div data-role="page" id="news" data-title="AreApp News" data-theme="c">
    <div data-role="header" data-theme="c"></div><!-- /header -->
    <div id="newscontent" data-role="content" data-content-theme="c"></div>
    <div data-role="footer"></div>
</div>

Below I use the click event detection by the id of the element which was clicked and call the database loading function which fetches and put the content to correct div.

$(function() {
    $('#news_link').click(function(){ // event handler of newslink
        loadNewsFromDB(function(){
            $.mobile.changePage( $("#news"), { transition: "slideup"} 
         );
    });
});

function loadNewsFromDB(callback){
    //DB-logic and html code generation here....
    $(htmlStr).appendTo( "#newscontent" ).trigger( "create" );
    $("#newscontent").html(htmlStr);
}

The logic works very well when I’m click the link for the first time. But when I put the “back” button of my cellphone so that I’m back at the mainmenu and click the link again, the content is not formatting right. I mean it shows the news, but the formatting is not good because it should use collapsible sets but it isn’t.

I’ve tried to clear the content with jQuery’s remove() and empty() functions by binding the use of the function to

$(document).bind( "pagebeforechange", function( e, data ) {
    var obj = $.mobile.path.parseUrl( data.toPage );
    if(obj.hash=="#mainmenu"){
        $('#news-collapsible').empty().remove();
    }
});

But without results. I’m quite stuck with the challenge and I would deeply appreciate if someone would tell me where to go with this.

  • 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-11T03:40:04+00:00Added an answer on June 11, 2026 at 3:40 am

    You need to refresh this collapsible set.

    $('#newscontent').collapsibleset('refresh');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some strange scrolling problems with my PhoneGap (using jQuery Mobile) app: I'm
I've built a Jquery Mobile Android App using Phonegap which contains a form with
i have a design issue regarding sending user data from a mobile phone app
I have a Mobile App (iPhone and Android) which allows user to login to
I have a jQuery Mobile web app which targets iOS and Android devices. A
I wrote a phonegap / jQuery mobile app which runs fun in the iphone
I have a jquery mobile app that i am wrapping in Phonegap for Iphone/Android
I have a full Jquery Mobile app the currently builds and looks fine in
I have a jquery mobile web app. On my iPhone when I am on
I have a single page jQuery Mobile app with four data-role='pages' in place; so,

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.