Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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
Question marked as Best reply

Posted on Jan 30, 2012 6:05 AM

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

3 replies
Question marked as Best reply

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

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 ID.