06-15-2013 08:05 PM
I am testing my existing WebWorks app on OS 10.2.0.341 and find an issue. When 'webworksready' event is fired, I find that DOM isn't ready yet and hence document.body returns null. Previously in 10.0 and 10.1, DOM is already ready. I am using BlackBerry 10 WebWorks SDK 126.96.36.199.
I could workaround it by registering webworksready event when DOM is already ready, but I'd like to know if this is an unexpected change. Or perhaps a new WebWorks SDK may "fix" it?
Does it happen to your apps, too?
Solved! Go to Solution.
06-16-2013 04:55 AM
Can I suggest you try the following?
Write an event handler then call it as part of body
In the event handler fire a loaded request to another handler
Finally trap the webworksready and call your init script
I use this sequence af things all the time and it is highly effective (you can even adapt it to Cordova + do Latent loads)
I must admit that getting to the solution was rather hard - the effect, however is a robust system I can reply on
06-19-2013 03:58 AM
Thanks. I figured the workaround for my app by registering webworksready event only when DOM is ready.
I am more thinking if it is an expected change in 10.2 or not. Quite a few WebWorks apps in BB World may got broken due to this change.
If it is an expected change (perhaps some apps don't need DOM ready and webworksready together), it may worth to be documented somewhere.
06-20-2013 08:53 AM
That's good feedback, thanks for sharing.
It is true that the DOMReady and webworksready events are independant. There is no guarantee that one will happen before the other unless you manage the workflow via event handling.