I have done more work on this and am now satisfied that there is indeed an openacs issue here. I think there were two problems. I have now eliminated the obvious one of the two.
I have triggered my script using:
Y.on("domready", myScript);
...so the timing issue has I think been eliminated, and certainly IE, Firefox and Safari all now render the page correctly on the first request and continue to work regardless of the number of times I refresh.
HOWEVER,
...taking Firefox as a good example:
http://192.168.0.100:8000/xowiki/home
[Page renders correctly, my script runs]
https://192.168.0.100:8440/register/?return_url=http%3a%2f%2f192.168.0.100%3a8000%2fxowiki%2fhome
[Log in proceeds but script does not run on re-direct. No Javascript errors shown and script tags on page appear identical.]
**REFRESH**
[No change]
**REFRESH**
[No Change]
**REFRESH**
[No change]
**REFRESH**
[No Change]
http://192.168.0.100:8000/register/logout
http://192.168.0.100:8000/xowiki/home
[My script fails to run!?]
**REFRESH**
[Page renders correctly, my script runs]
____________________________________________________________
With IE8 the picture is slightly different:
http://192.168.0.100:8000/xowiki/home
[Page renders correctly, my script runs]
https://192.168.0.100:8440/register/?return_url=http%3a%2f%2f192.168.0.100%3a8000%2fxowiki%2fhome
[Log in proceeds but script does not run on re-direct. No Javascript errors shown and script tags on page appear identical.]
**REFRESH**
[Page renders correctly, my script runs]
http://192.168.0.100:8000/register/logout
http://192.168.0.100:8000/xowiki/home
[My script fails to run again!?]
**REFRESH**
[Page renders correctly, my script runs]
There is something that these browsers don't like about this. Could it be the temporary redirect to https for the login and then the switch back? I have considered the Javascript 'same origin' policy as the problem but if the browser is caching the script for the redirected page, it surely must think the origin is the same?
Could it be that we need to fully qualify the url for the script in the header script tag? I tried to exploit the fact that urls containing a question mark are not cached but when I rename my javascript file to end with a ?, xowiki substitutes a character code.
I don't really want to have to direct that the whole page is not cached because there are images that I would like cached. Does anyone have any insights?
Regards
Richard