With the TAU library, you can move to any page in your application using the tau.changePage() method.
Note |
---|
To change pages with TAU, DO NOT USE location.href or location.replace. TAU has a self-method for managing histories, and if you use the above methods, it can cause confusion.
To change pages, use tau.changePage() and tau.back(). |
Method | Description |
---|---|
tau.back ( ) |
Loads the previous page in the history list. |
tau.changePage (toPage, options) |
Programmatically changes to another page. The to argument is a page object or string. |
tau.back
Loads the previous page in the history list.
tau.back ( )
Same as: window.history.back()
Code example:
<script> tau.back(); </script>
tau.changePage
Programmatically changes to another page.
tau.changePage (toPage, options)
Parameters:
Parameter | Type | Required/optional | Description |
---|---|---|---|
toPage | HTMLElement | string | Required | Target page defined with an HTML element or the relative URL of the page. |
options | Object | Optional | Options for changing pages. |
Options
Option | Type | Value | Description |
---|---|---|---|
transition | string | 'sequential' | 'simultaneous' | 'flip' |'depth' | 'pop' | 'slide' |'turn' | Transition for the opening page. |
reverse | boolean | true | false | If true , the transition must be reversed. |
Code example (using an HTML element):
<div data-role="page" id="main">...</div> <script> var element = document.getElementById("main"); tau.changePage(element, {transition: 'flip', reverse: false}); </script>
Code example (using a URL string):
// This is "index.html" and assumes that there is "subPage.html" in same directory <script> tau.changePage("subPage.html"); </script>