Nokia S40 Ovi browser web application tips and tricks

4k views Asked by At

What are some tips and tricks when developing web applications using the Series 40 Ovi browser platform?

2

There are 2 answers

0
ariefbayu On BEST ANSWER

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.
}
0
ariefbayu On

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>