Reputation: 21979
What are some tips and tricks when developing web applications using the Series 40 Ovi browser platform?
Upvotes: 1
Views: 4092
Reputation: 21979
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.
}
Upvotes: 1
Reputation: 21979
When adding inline JavaScript code, you should wrap your code in "
(double-quote). It runs on the emulator, but will fail on the device.
For example:
<div id='runner' onclick="mwl.addClass('#header', 'hide');mwl.removeClass('#container', 'hide');">command</a>
Upvotes: 0