Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

New Contributor
Posts: 3
Registered: ‎02-12-2012
My Device: Playbook
My Carrier: Orange

Javascript in QML

Hello guysSmiley Wink


i am newbie so fogivme if my question is totaly dump.

So, I read this https://developer.blackberry.com/cascades/documentation/dev/javascript/index.html

and, can i use all javascript functionality qml? like in web programming -  function like setInterval() etc ?

Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Javascript in QML

Generally you can use all the functionality which is a core part of JavaScript, but little or none of the functionality which is typically provided by the browser. The setInterval() features are provided by the browser, so not inherent in JavaScript and not available in QML. You can, however, register the QTimer class from Qt and use that. The forum search feature would probably show examples of it, or the docs or sample apps probably mention it as well. Building on top of that, you could actually reimplement the entire setInterval/setTimeout functionality, if you wanted to.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!