I\'m using jQuery mobile and currently build a menu on the fly using the code below. I now need to create actual pages for menu items as my next step. I have been looking at
There is a cashing problem if you want to recreate the page with new content. So you must do this...
var $i = 0;
$('#test').on('click', function () {
$i++;
alert("I="+$i);
// Prepare your page structure
var newPage = $("BackDynamic Page
Stuff here = " + $i + "");
// Append the new page into pageContainer
newPage.appendTo($.mobile.pageContainer);
// Move to this page by ID '#page'
$.mobile.changePage('#page');
});
$(document).on('pagehide', '#page', function(){
$(this).remove();
});
test