Page Transition
If you use the Kii Cloud SDK for JavaScript in HTML pages, be careful about the reset that occurs on page transition.
Normally, you would implement a single page application which switches the contents within a single page by using some framework. See Implementing an HTML5 App in the tutorial for background information.
You can switch pages with pagecontainer()
of jQuery without any framework.
$('body').pagecontainer('change', 'nextpage.html', { transition: 'slide' } );
Necessary processes for page transition
It is not recommended implementing an app which makes page transition. However, if you choose to design your app with page transition, note the followings.
Initializing the SDK
You need to initialize the SDK by executing Kii.initializeWithSite() on each page transition. For the details on the SDK initialization, see this page.
Maintaining the login state
You need to restore the login state on each page transition.
For example, you can save the access token in the Web Storage when the user successfully logs in. When a page moves, you can restore the access token to restore the login state. For more information on the access token and login state, see this overview and sample implementation.