Welcome!

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

Web and WebWorks Development

Reply
Contributor
pmulkins
Posts: 11
Registered: ‎10-27-2012
My Device: LE Z10
My Carrier: Telus
Accepted Solution

Javascript not working in Ripple or BB10 Dev Alpha A

Hello everyone, 

 

I am trying to create a webworks app specifically for BB10.  I have created my html and is working, but when trying to port it to the bb10 it no longer works.  To be more specific, my in-line javascript wont execute. 

 

Is there any reason this (see below) should work?

"value1 = window.document.form1.input1.value; "

 

The idea is the user fills in a simple form, presses a 'calculate' button and some math is performed, very basic stuff.  But, when I press calculate nothing happens.  Any ideas?

 

I have been using bbui to wrap everything around, and have followed: https://github.com/blackberry/bbUI.js/wiki/Screen-Specific-CSS-and-JavaScript

 

Thanks in advance!

 

Phil

Please use plain text.
Trusted Contributor
usr501
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: Javascript not working in Ripple or BB10 Dev Alpha A

pmulkins,

need to see javascript file relating to the individual form inputs and need to see the html markup of the form itself. :smileyvery-happy:

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Javascript not working in Ripple or BB10 Dev Alpha A

[ Edited ]

When you say inline javascript, are you talking about a bbui svreen with a javascript tag having code on the screen page?  If so that wont work.  You need to have a javascript tag referring to external JS code file.  That will work.

 

See the explanation here:

https://github.com/blackberry/bbUI.js/issues/28

 

I do see on the bbui site an example of inline code but I'm not sure thats working.  Maybe you should post an issue on github for help.  They answer pretty quickly there.

https://github.com/blackberry/bbUI.js/issues

 

You may need to supply some code though.

If it helped you, click like. :smileyhappy:
Please use plain text.
Contributor
pmulkins
Posts: 11
Registered: ‎10-27-2012
My Device: LE Z10
My Carrier: Telus

Re: Javascript not working in Ripple or BB10 Dev Alpha A

Ok, I will try and seperate out the js.  Thanks!

Please use plain text.
Contributor
pmulkins
Posts: 11
Registered: ‎10-27-2012
My Device: LE Z10
My Carrier: Telus

Re: Javascript not working in Ripple or BB10 Dev Alpha A

Thanks for the help. As per Tim Neil - which he also recommended to take out the js and into a separate file, and some web inspector work I found the error in my code.

Please use plain text.