My Air application uses a sandboxed iframe and its source htm
page is loaded from a location other than application directory. I
have included a init.js file in the htm page of iframe.
Now, on basis of some user input I periodically update the
init.js (I 'write' the file- it contains object and variable
instantiation,etc) file. To visually show changes I have tried to
reload the htm page of iframe through several methods however the
htm page keeps 'showing' contents according to 'previous' version
of init.js file even though init.js has changed.
The methods that I have used to 'reload'/'refresh' the iframe
htm page are:
> load a 'empty.htm' page in iframe and then cause it to
ask parent sandbox bridge to set iframe source back to orignal htm
page for iframe.
> set iframe src to empty i.e. iframeEl.src = '';
> use reload function .i.e
> include the following tags in the htm page to be loaded
in the iframe:
<meta http-equiv="Content-Type" content="text/html;
<meta http-Equiv="pragma" Content="no-cache" />
> set iframe src with dynamic query string e.g.
iframeEl.src = 'my.htm?' + timeObj.getMilliseconds().toString();
Can anyone please shed light on how to 'refresh' iframe page
so that it starts 'including' updated js file ?
Thanks a lot for any/all help.
The file is not stored in application directory.
As far as js file is concerned my boss solved this stumbling
block by suggesting that i use 'document.createElement("script")'
to include the js file to head of my htm page ( that opens in the
iframe). Now the htm file finds the newer version of js thanks to
dynamically created script tag with a uniques query string.