The script overwrites document.write in order to serialize all rendering
The first version of openx.js had sometimes freezed the IE 8. The cause of
this probably was a race-condition while moving the nodes with the banner
to their final destination.
Because of that, the script serializes all modifications of the DOM
strictly now. Implementation-Details:
* The HTML delivered by OpenX is parsed, in order to detect included
script-tags.
* HTML-code is written to the destination-node directly.
* script-tags, that load additional code are loaded via a script-node,
that is appended to the end of the page. The script waits, until the
additional code is loaded, by adding an onload-event to the appended
script-node.
* script-tags with inline-code are executed directly via eval().
* Calls to document.write() in the additional scripts are catched. To
achieve that, openx.js overwrites document.write with its own
implementation, that simply adds the code to an execution-queue, that
is processed, when the onload-event fires or when the eval()-call
returns.
TODO:
* Not tested with IE!