What are some tips and tricks when developing web applications using the Series 40 Ovi browser platform?
For every code that is run on function()
, the Ovi browser will forward it to server to interpret it. So, make sure you do a minimal function() call. If you have to do it, try to use mwl.timer()
to add a nice loading effect.
For example:
In index.html
:
<div onclick="loadNews()">load news</div>
In code.js
:
function loadNews()
{
mwl.addClass('#navigation', 'hide');
mwl.addClass('#container', 'hide');
mwl.removeClass('#loader', 'hide');
//Ajax call here.
}
You can optimize it to:
In index.html
:
<div onclick="mwl.addClass('#navigation', 'hide');mwl.addClass('#container', 'hide');mwl.removeClass('#loader', 'hide');mwl.timer('loadNewsTimer', 10, 1, 'loadNews()')">load news</div>
In code.js
:
function loadNews()
{
//Ajax call here.
}