Linking between mobile pages
The second important concept in jQM is how the mobile pages are being linked together. Understanding this concept can help us to design a web mobile application with a fluid user experience. In jQM, there are two ways to load an external mobile page:
HTTP and Ajax. Depending on how we set the data-
attribute, it interprets the href
value and decides which way to load a mobile page. By default, apart from the first document load which is a normal HTTP transfer, the mobile page is loaded through Ajax. The following block diagram explains how multiple mobile page blocks are managed within a document:
When a mobile page invokes another mobile page, the jQM framework basically parses the href
value. Since this is an anchor reference, it indicates that this is an internal mobile page block. The framework locates the page block from the current DOM by matching the id
value. It then initializes and renders the page which also triggers the pageinit
event for page B as...