03-18-2012 12:13 PM
Hi,
Using bbUI toolkit, from my index.htm, I called bb.onscreenready with the following
<script type="text/javascript">
bb.onscreenready = function(element, id) {
if (id == 'manage') {
initializeDB();
}
}
</script>
on my 'manage' screen, I have the following
<div data-bb-type="screen">
<script id="manage" src="manage.js"></script>
<center><div data-bb-type="title" data-bb-caption="manageScreen" ></div></center>
<style type="text/css">
body, html {
background-color: White;
}
</style>
<div id="results">
<h1>Result should be here!</h1>
</div>
</div>
and on my manage.js, once fired from onscreenready, supposedly change the content of id="results" to something else via document.getElementById("results").innerHTML = ('Changed!');
But this are not the case. Value for the object is null. Am I not doing it correctly?
03-18-2012 03:00 PM
Is this for Smartphone or Playbook?
Either way try putting the inializeDB() into a setTimeout() of a second and see if it works then. Not a solution a great solution, I am just wondering if the bb.onscreenready is firing off too early.
03-22-2012 11:07 AM
Try to access it through the element object:
element.getElementById("results").innerHTML = ('Changed!');