User214117797 posted
Unfortunately, when developing mobile applications you are limited do client side scripting.
Only HTML devices will support javascript and even then you will get strange behaviour.
I do not think there is any other client scripting alternatively, so I would suggest not to even use javascript if you want to target devices other then HTML browsers.