Dynamically creating jQuery Mobile pages using jQuery Templates -
i building workout catalog using jquery mobile ui , jquery templates deal html. have been able append html created page , jquery mobile change markup .page() function.
however, want able create new jq mobile pages. can inject code divs data-role=page, call .page() on , it's fine. appending made page body not work.
edit: question , answer refers jquery mobile alpha 3
ok got it. if want add dom have add value data-url. when create static html page,
<div data-role="page" id="home">
jquery mobile automatically adds data-url equal id give it. when yourself, have hold hand , pass data-url="home".
when generate html string append $.mobile.pagecontainer jquery mobile knows find (appending body works also, it's best not rock boat). after that, call .page() on page in dom jquery mobile of magical <span>
magic make pretty.
$('#home').page();
Comments
Post a Comment