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: 
Picture loading from jQuery: 
I have refreshed the list too, but not working. I don’t know what the problem is.
Please help me.
Thanks,
-regeint
I’m not sure how you
refreshanabvarwidget in the jQuery Mobile framework but I know that you can remove the previousnavbarand insert a fresh one: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))).