As I know that in JQuery Mobile, every page changing is equivalent to create new “page” div, Can we just change a portion in the “content” of the page, something like subpage?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
jQuery Mobile doesn’t require you to manage pages by creating additional
divelement in the same HTML file – you can do it perfectly fine in a different HTML file and make a transition to it (perhaps withdata-prefetchattribute set) using<a>.Nothing prevents you from writing a jQuery plug-in, jQuery UI plug-in or (scary though, I know) pure JavaScript that will alter the contents of the DOM element dynamically and manage pages loading according to data received from server – with necessary calls to things of the
listview('refresh')ilk – to ensure proper styling.With that said you have to ask yourself two things:
Why do you need to do it? Can’t you manage by pre-creating the page using jQuery Mobile paradigm and just retrieving and inserting the data into the new page?
What will the performance implication (if any) will be, if I have to perform DOM manipulations on every ‘page transition’?
As a side note – jQuery Mobile provides you with methods that allow for page manipulation:
$.mobile.changePageand$.mobile.loadPagethat you can use (look atpageContaineroption).See API docs here