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

  • Home
  • SEARCH
  • 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 6986563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:49:31+00:00 2026-05-27T18:49:31+00:00

I am using jQuery Mobile for my PhoneGap app in Xcode. I have created

  • 0

I am using jQuery Mobile for my PhoneGap app in Xcode. I have created multiple pages having tabs in footer. It works properly in static page as follows.

<div data-role="footer" data-position="fixed">      
    <div data-id="mainTab" data-role="navbar">
        <ul id="footer_tabs">
            <li><a href="search_page.html" data-transition="slideup" data-icon="search">Search</a></li>
            <li><a href="my_favorite_page.html" data-icon="star" data-transition="slideup">Favorites</a></li>
            <li><a href="my_account_page.html" data-icon="gear" data-transition="slideup">Account</a></li>
            <li><a href="create_ad_page.html" class="ui-state-persist ui-btn-active" data-transition="slideup" data-icon="plus">Create Ad</a></li>
        </ul>
    </div>
<div>

When I tried to load tabs according to user role.
HTML code in page :

<div data-role="footer" data-position="fixed">      
    <div data-id="mainTab" data-role="navbar">
        <ul id="footer_tabs">
        </ul>
    </div>
<div>

jQuery code:

$('#footer_tabs').append('<li><a href="search_page.html" data-transition="slideup" data-icon="search">Search</a></li>');
$('#footer_tabs').append('<li><a href="my_favorite_page.html" data-transition="slideup" data-icon="search">Favorite</a></li>');
$('#footer_tabs').append('<li><a href="my_account_page.html" data-transition="slideup" data-icon="search">Account</a></li>');
if(userRole == '3'){
    $('#footer_tabs').append('<li><a href="create_ad_page.html" data-transition="slideup" data-icon="search">Create Ad</a></li>');
}
$('#footer-tabs').listview('refresh');

Picture of static loading: enter image description here

Picture loading from jQuery: enter image description here

I have refreshed the list too, but not working. I don’t know what the problem is.
Please help me.

Thanks,
-regeint

  • 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-27T18:49:32+00:00Added an answer on May 27, 2026 at 6:49 pm

    I’m not sure how you refresh a nabvar widget in the jQuery Mobile framework but I know that you can remove the previous navbar and insert a fresh one:

    //create an output variable, I used an array
    var output = ['<div data-id="mainTab" data-role="navbar"><ul id="footer_tabs">'];
    
    //push items onto the output array
    output.push('<li><a href="search_page.html" data-transition="slideup" data-icon="search">Search</a></li>');
    output.push('<li><a href="my_favorite_page.html" data-transition="slideup" data-icon="search">Favorite</a></li>');
    output.push('<li><a href="my_account_page.html" data-transition="slideup" data-icon="search">Account</a></li>');
    if(userRole == '3'){
        output.push('<li><a href="create_ad_page.html" data-transition="slideup" data-icon="search">Create Ad</a></li>');
    }
    output.push('</ul></div>');
    
    //this last line is important, the output array is being joined into a string, then appended to the footer element,
    //also the `create` event is being triggered on the footer element so the jQuery Mobile framework will update the widget with all the necessary styles
    $('[data-role="footer"]').html(output.join('')).trigger('create');
    

    Here is a demo: http://jsfiddle.net/ZVGSZ/

    Notice that I created an array of HTML strings and then joined them together to do a single .append() rather than an append for each HTML string (.html(string) == (.remove() + .append(string))).

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

Sidebar

Related Questions

I'm making an PhoneGap app using Jquery Mobile, but I have a little problem
I am developing a Android app using Jquery Mobile/Phonegap. I have the following code
I am creating a webapp for iPhone using jQuery Mobile and PhoneGap. Everything works
I have created a mobile version of my website using jquery mobile. My site
I've built a Jquery Mobile Android App using Phonegap which contains a form with
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
I'm working on my first PhoneGap app with JQuery Mobile and I've having a
In my PhoneGap/jQuery Mobile app, I'm currently using PhoneGaps' Camera API to allow the
I'm developing a mobile app using PhoneGap and jQuery Mobile. From what I've read
I'm making an app on PhoneGap using Jquery Mobile. The app runs fine on

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.