I have the following snippet which is causing grief:
The script is inside a url loaded into an iframe.
Basically, I am trying to write insert text into a <div> in the parent window when the page loads and remove it when it unloads.
The code inserts the text correctly as the pages loads, but does not remove it on unload. However, if I switch the events round, the text is written and then immediately overwritten by the onunload.
I have tried addressing the object as 'this', the document, the window. No good.
Any help would be much appreciated.