I have a 2 pages in a document. The active page displays a list and on click on the list, I display the second page. The content div of the second page is dynamically added along with some custom css in the JS. The below Java script does this job, but I am not able to get the css render.
$("#showmore").live("click", function(event, param1){
getUrl = $(this).attr('data-href');
$.post(getUrl, function(data){
$.mobile.hidePageLoadingMsg();
$('#more').html(data);
$.mobile.activePage.page().trigger('refresh');
});
});
I also tried $.mobile.activePage.trigger('create'); .This works, but I go back and forth the two pages. But when i click on the list the second time the contents does not get rendered at all. Its a blank page with just the header!
Can anyone share your expertise on how I can go about adding dynamic contents with css to a secondary page and display it as many times I want to from the same page?
!importantin your CSS declaration or you could make more specific CSS rules so they are used over the jQuery Mobile classes:.ui-mobile .ui-page .ui-content .ui-listview .ui-li .ui-btn { color : hot-pink; }... for example will override the jQuery Mobile styles because it is so specific (but will work for all buttons inside list-view list-items inside the content section inside a pseudo-page inside a jQuery Mobile webpage).