I need to load JavaScript code (which I don\'t have control over) from a URL into a div. The JavaScript code is a bunch of document.write() statements. Once the document.write()
what you can do is::
1) initially set the div box to something default (zero or null)
2) set a timer, for 500/1000 MS and check if the text of the div has changed since last time or not.
3) if text is still default, goto 2
4) if text has changed and timeout, take the value as final value, else goto 2.
considering that the remote JS will do all the writing at once, that is, there is no large gap between its document.writes