- If this page is the first page loaded then the back button is clicked which is NOT "/"
<a href="/" data-role="button" >Home</a>
- If this page is the second page (sub page) and the first is "/" then JQM loads a second "/" as a sub page.
<a href="#home" data-role="button" >Home</a>
- Only works if #home is already loaded and the current page is not #home
So what home link do I put on a page that can be loaded by itself or as a sub page? The only way I can be sure to get to the home page is to turn off JQM loading!
Where JQM will try to perform a back if the back button keeps you within the current JQM page. Otherwise it will perform a full reload of the href? Or <a href="/" data-role="button" data-rel="firstpage" >Home</a>
I have read a lot of posts about updating form elements and injecting html into an already loaded page. To me this seems an important part of any dynamic site. For example, on a form submission I either want to return a dialog indicating the next step or return the user to the form with errors indicated. The problem is that any new/replaced HTML elements are not styled.
I have read that using $(#element).page will work, but this does not work on an existing page and should not be used in general unless you are creating a page. I have also read that you should change the content of an element and use xxx("refresh"). Refreshing an element is only useful if you only need to update its content. Refreshing elements does not work well with partials or if you need to add/remove/change elements.
The code to re-parse an element is already written. Is just not exposed in a useful way. I propose that a function for re-parsing a portion of a page (or current active page) be added to the API. That way when I am updating more than just a list I can easily re-style the page.
By the time I identified all of the elements I update I ended up pulling the code from page.. Please make the styling code available for me to call from jquery mobile
function refreshElem(element) {
var keepNative = ":jqmData(role='none'), :jqmData(role='nojs')"
//some of the form elements currently rely on the presence of ui-page and ui-content
// classes so we'll handle page and content roles outside of the main role processing