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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:02:23+00:00 2026-06-07T08:02:23+00:00

I am relatively new to jQuery Mobile. So, I do not know every corner

  • 0

I am relatively new to jQuery Mobile. So, I do not know every corner of the framework capabilities.

I am currently facing some problems with history and dynamic page navigation.

Basically, I want to achieve the following:

I have a web page that changes content by button clicks. The “home” page should display the <div data-role="page" id="list_root">...</div>. By clicking a button the page should navigate to <div data-role="page" id="list_123">...</div>. I want to be able to get back to the content of div “#list_root” by using the back button.

Prior to using jQuery I did implement this by myself with history.pushState(divContent, null, "#list_<id>") and replacing the old content with the new one. However, the pushState plugin is deactivated by default using jQuery mobile.

The button that is pressed to navigate is defined like the following:

<a href='#list_<id>' class='...'>...</a> 

I did try to implement the creation of the new div content (for list_) by implementing a callback for “onhashchange”. But this event gets never called.

Futhermore, if I would be able to create the content when the link was clicked, I would like to show the content of <div id="list_<id>">, replacing the previous content.

Since the application presents mass data – I did not want to use jQuery mobiles’ nested list.

Do you have any hints for me how I can implement this using the framework functionality?

EDIT:

I have the following situation:

<div data-role="page" class="type-interior" id="main_window">
    <div id="current" class="ui-content" data-role="content" role="main">
        <div id="list_root" data-url="list_root">
        <div id="list_123" data-url="list_123" data-role="page">
    </div>
</div>

As you see “list_root” is the default “start page” and gets displayed as intended.

I added an event listener for click() to dynamically create the content of <div id="list_123"> via:

document.addEventListener('click', function(e) {
       ... create it ...
       e.stopPropagation();
   }, true)

This works.

The button is created like the following:

<a href="#list_123" data-role="button">List_123</a>

The div content gets created successfully and after that the hash in the url changes to #list_123. But the page is not displayed. Is the problem here, that <div data-role="page" id="list_123">...</div> stands within the <div data-role="page" class="type-interior" id="main_window"> tag? I’ll try that next!

  • 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-07T08:02:24+00:00Added an answer on June 7, 2026 at 8:02 am

    as stated above – the problem that I had was, that a new page to which you want to navigate has always to be inside <div data-role='page'><div data-role='content'>....</div></div> tags and a child element of the body tag.

    Now it works fine!

    Thanks!

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

Sidebar

Related Questions

Relatively new to JQuery. I've got some code that does a banner swap with
I am relatively new to jquery and jquery mobile. I have a new mobile
I am relatively new to implementing JQuery throughout an entire system, and I am
I'm relatively new to jquery/ajax, and I'm having trouble parsing the results from a
I'm relatively new to JQuery. I'm trying to understand how to select a child
Possible Duplicate: Jquery Tabs- Load Contents only when clicked Hi, I am relatively new
I am relatively new to using jQuery and I have a problem with creating
Simple question really, I am relatively new to both jQuery and XML. I just
I'm relatively new to jQuery. To me, there's three sets of controls (html controls,
I am relatively new to jQuery, and I would like to be able 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.