How to refresh html widget on open

Hi


I have made html widget that contains simple drag&drop game with html5 and java script. Problem is that in browser if i refresh (F5 or cmd+R) it reloads page and starts onload() function in body if my html document. But in iBook closing widget and than opening it again does not force refresh or onload() function in body of my html document. How do i force oload() every time user opens html widget?


tnx

Luka

iBook, iOS 5.0.1

Posted on Jan 30, 2012 5:19 AM

Reply
3 replies

Jan 30, 2012 6:05 AM in response to luka.mis

You need to define the widget.didEnterWidgetMode function in your javascript for this. It will get called when your widget gets reopened from a document, and from here you can call your onload, init or start functions as required.


e.g. :


widget.didEnterWidgetMode = function(widgetState) {

// Call functions here as needed


}


Note that this only gets called on reopening events (not on the very first time your widget loads - use onload as usual for this).


Rhys

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to refresh html widget on open

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.