11-24-2012 02:02 PM
Well, I tried to do this in my function
$(document).ready(function() {
console.log("ima ready");
bb.pushScreen('results.htm', 'results');
});
It doesn't work, I get Uncaught ReferenceError: element is not defined
How to do that?
11-24-2012 09:31 PM
Does it say that bb is not defined?
11-25-2012 11:15 AM
I am not sure, I just see that in Ripple console...
I call it from an external function.
I do like this
The main menu loads a "please wait" page, the I do my data loading (around 3 seconds), and then I want to call the results page.
11-25-2012 04:33 PM
Stupid question: do You have included jQuery script?
It's look like Ripple or Web Browser don't recognize "$"
11-25-2012 06:04 PM
Yes jquery is loaded from the first page
Maybe I did it wrong?
Later I will check
11-27-2012 12:37 PM
11-27-2012 12:44 PM
Also, are you initializing bbUI.js before trying to push?
try following this example: https://github.com/blackberry/bbUI.js/wiki/Toolkit
<html>
<head>
<link rel="stylesheet" type="text/css" href="bbui-0.9.4.css"></link>
<script type="text/javascript" src="bbui-0.9.4.js"></script>
<script type="text/javascript" src="js/webworks-1.0.2.9.js"></script>
<script type="text/javascript">
document.addEventListener('webworksready', function(e) {
bb.init();
// Open our first screen
bb.pushScreen('firstScreen.htm', 'firstScreen');
}, false);
</script>
</head>
<body>
</body>
</html>
11-27-2012 02:36 PM
But it's already initialized
I initialize again?
11-27-2012 02:45 PM
I explain better what I do
index.htm initializes bbui.js and loads the page with
bb.pushScreen('load.htm', 'load');
load.htm is loaded and displayed
at the end of the screen div there is this js:
<script type="text/javascript">
console.log("i will run my function");
myfunction('address');
console.log("i ran my function");
</script>
As expected, console displays both lines.
myfunction is loaded
function myfunction(address)
{
console.log("myfunction start!");
localStorage.setItem.... (my stuff)
...
console.log("i try to push the page");
bb.pushScreen('results.htm', 'results');
console.log("pushed");
}
I get all the console lines except pushed, and the page is not pushed.
I guess because I am pushing the screen in the wrong way
11-27-2012 03:48 PM