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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:59:59+00:00 2026-05-27T20:59:59+00:00

I have create dynamic listview based on database but the problem is to load

  • 0

I have create dynamic listview based on database but the problem is to load the listview i have to refresh the page again.

for example ,

Page A.html has a button and Page B.html has a listview

when i click on button which is inside page A.html page B.html loads but the listview
is not visible and when i refresh the B.html again then the listview loads.

Code of page A i.e. index.html when click on findme page B loads

<div data-role="content">   
        <p>
               <a href="findme.html" id="findMeBtn" data-role="button" data-icon="delete">Find Me</a>
               <a href="index.html" data-role="button" data-icon="delete">Fingle Hunts Basic</a>
               <a href="index.html" data-role="button" data-icon="delete">Communicator</a>  

        </p>


        <p>
         <div id="action">
              <div id="loading-icon"></div>
              <div id="msg"></div>
         </div>
        </p>
</div><!-- /content -->

Code of Page B i.e.findme.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Find Me</title>
<link rel="stylesheet" type="text/css" href="style/jquery.mobile.css"/>
<link rel="stylesheet" type="text/css" href="style/main.css"/>

</head>

<body>
    <div data-role="page"  id="findme">
    <div data-role="header"  data-theme="b">
        <a href="index.html" data-icon="back">Back</a>
        <h1>VisitFingal</h1>

    </div><!-- /header -->
    <div data-role="content" >  
    <center>
    <div class="vf-nav-view vf-button-panel" >
        <div data-role="controlgroup" data-type="horizontal" data-fullscreen="true" >
            <a href="index.html" data-role="button" style="width:30%;" data-theme="b">List</a>
            <a href="index.html" data-role="button" style="width:30%;" data-theme="b">Map</a>
        </div>
    </div>
    </center>

    <div id="findMeListView">

    </div>


    </div><!-- End of FindMe Page -->
    <div data-role="page"  id="details">
         <div data-role="header"><h1>Details</h1></div>
        <div data-role="content"></div>
    </div>
    <div data-role="footer"  data-theme="b"  data-id="mainfoot" data-position="fixed">
    <div data-role="navbar">
        <ul>
            <li><a href="index.html" >Home</a></li>
            <li><a href="findme.html"  class="ui-btn-active ui-state-persist">Find Me</a></li>
            <li><a href="#">Communicatior</a></li>
            <li><a href="#">Like</a></li>
            <li><a href="#">Favourates</a></li>
        </ul>
    </div>

    </div><!-- /footer -->

    </div>
</body>
<script src="js/jquery-1.6.3.min.js" type="application/javascript"></script>
<script src="js/jquery.mobile.js"  type="application/javascript"></script>
<script type="application/javascript">

        $(document).bind( "pagebeforechange", function( e, data ) {



          $.getJSON('getData.php', function(data) {
                  var items = [];
                $page  = $("#findme");
                $content = $page.find("#findMeListView" );
                var listViewData='<ul data-role="listview" data-filter="true" data-inset="true" data-theme="c" >';
                for (var i=0; i <data.length;i++)                   
                {
                    listViewData += '<li><a href="details.html?id='+data[i].id+'"><img height="95" width="95" src="'+data[i].url+'" /><h3>'+data[i].name+'</h3></li>';

                }
                     listViewData+='</ul>';

                    $content.html(listViewData);
                    $content.find( ":jqmData(role=listview)" ).listview();



          });


        });

</script>
</html>
  • 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-27T20:59:59+00:00Added an answer on May 27, 2026 at 8:59 pm

    When you use a multi-page template like this the JS will be ignored when you click from page A to page B. This is because jQuery Mobile AJAX linking pulls just the first data-role="page element from the new page and appends it to the current DOM, as you can imagine this ignores any code outside the data-role="page element.

    Two fixes:

    1. Put the JavaScript code for page B directly in the data-role="page element so it will be parsed when jQuery Mobile does an AJAX load of the page.

    2. Put all the code for your site into a single JS include file and include it in the <head> of every page; this way all the code for your site will be available whether the user refreshes or deep-links into the site and when they navigate around using jQuery Mobile’s AJAX linking. This is my preferred method.

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

Sidebar

Related Questions

Does python have the ability to create dynamic keywords? For example: qset.filter(min_price__usd__range=(min_price, max_price)) I
I have a data load scenario where I create dynamic sql query to pull
I have a page in which I create dynamic controls via OnInit. On the
I am trying to create a dynamic bar in HTML using javascript. I have
I have an issue with dynamic, runtime controls. I create a group of controls
I have seen some ListView dynamic growing implementations which use OnScrollListener. I would like
I have a dynamic ListView which uses an ArrayAdapter . When a name is
i have create 5 dynamic buttons in 1 row and store the button info
i have create 7 dynamic buttons in a scroll box. Each row need to
I have a button R1 which is dynamic and create in an expanded list

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.