javascript - Jquery mobile not rendering all 'data-role="pages"' present in an html file -
I have an html file in my web-folder, which can only be accessed by servlet here. How my servlet requested for that html page
ServletContext context = getServletContext (); Request Dispatcher rd = context.getRequestDispatcher ("/ WEB-INF / file.html"); Rd.forward (req, resp);
My file.html has 2 data-roll = "pages", but only 1 data-role = "page" is being translated. Do you have any ideas, because only 1 out of 2 pages is being provided by jquery-mobile here is my file.html template.
& lt; Div data-role = "page" id = "profile-page" data-dialog = "true" & gt; ... & lt; / Div & gt; & Lt; Div data-role = "page" id = "home-page" & gt; ... & lt; / Div & gt;
So basically forwards my Overlit to file to user.html, this is one reason why a page is not being created.
In jQuery mobile, we can only show one page at a time, because each page has a full visible height lives on.
Multipage template option is available, but here we can only show one page at a time, but we can link to other pages with the help of navigation.
Sample code for multipage template from jQuery docs
& Lt; / Div & gt; & Lt ;! - / header - & gt; & Lt; Div role = "main" square = "ui-content" & gt; & Lt; P & gt; I am in the first source sequence, so I was shown as the page. & Lt; / P & gt; & Lt; P & gt; & Lt; A href = "# bar" & gt; Bar & lt; / A & gt; & Lt; / P & gt; See internal page named & lt; / Div & gt; & Lt ;! - / content - & gt; & Lt; Div data-role = "footer" & gt; & Lt; H4 & gt; Page footer & lt; / H4 & gt; & Lt; / Div & gt; & Lt ;! - / footer - & gt; & Lt; / Div & gt; & Lt ;! - / Page - & gt; & Lt ;! - Start of second page - & gt; & Lt; Div data-role = "page" id = "bar" & gt; & Lt; Div data-role = "header" & gt; & Lt; H1 & gt; Bar & lt; / H1> & Lt; / Div & gt; & Lt ;! - / header - & gt; & Lt; Div role = "main" square = "ui-content" & gt; & Lt; P & gt; I am second in the source sequence, so I have hidden the page load. I have been shown only if a link references my ID, it is clicked. & Lt; / P & gt; & Lt; P & gt; & Lt; A href = "# foo" & gt; Back to Foo & lt; / A & gt; & Lt; / P & gt; & Lt; / Div & gt; & Lt ;! - / content - & gt; & Lt; Div data-role = "footer" & gt; & Lt; H4 & gt; Page footer & lt; / H4 & gt; & Lt; / Div & gt; & Lt ;! - / footer - & gt; & Lt; / Div & gt; & Lt ;! - / Page - & gt; & Lt; / Body & gt; Note:
What you are trying to do with many pages is not possible You use a page And show / hide specific devices according to your needs. You have to write your logic, jQuery mobile can not help in this scenario.
Reference:
Comments
Post a Comment