What are some tips and tricks when developing web applications using the Series 40 Ovi browser platform?
Asked
Active
Viewed 4,068 times
1
-
can anyone mark this question as community wiki? – ariefbayu May 27 '11 at 09:19
-
1Or vote to close (as it's not a programming 'question') – KevinDTimm May 27 '11 at 09:30
-
It's not, but it's related to programming. – ariefbayu May 27 '11 at 09:35
-
3@silent - what is the question? Community wiki is a destination, not a starting point. – KevinDTimm May 27 '11 at 09:39
-
Hello and welcome to Stack Overflow! Note that we have a nice [FAQ](http://stackoverflow.com/faq). To quote: "What kind of questions should I not ask here? You should only ask practical, answerable questions based on actual problems that you face. Chatty, open-ended questions diminish the usefulness of our site and push other questions off the front page." "Tips and tricks about X" is not an answerable question. – Piskvor left the building May 27 '11 at 10:46
-
ah, I see. I though this kind of question is accepted too just like on wordpress.se. – ariefbayu May 27 '11 at 11:01
2 Answers
1
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.
}

Peter Mortensen
- 30,738
- 21
- 105
- 131

ariefbayu
- 21,849
- 12
- 71
- 92
0
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>

Peter Mortensen
- 30,738
- 21
- 105
- 131

ariefbayu
- 21,849
- 12
- 71
- 92