Has anybody else ever experienced a situation whereby an ONLOAD event placed in a tag starts executing before all the outputted text (in this case, XML) has appeared in the HTML it's called from? I say 'appeared' because the XML is written using Response.Write, but doesn't seem to appear in the page sent to the client until after the ONLOAD event has begun.
Basic structure of ASP page sent to client:
The HTML and XML are both written by the same procedure at the server. However, although all of the HTML / XML is written synchronously, when the client receives the response, the HTML appears and begins to execute ONLOAD javascript functions before the accompanying XML appears.
Some of the ONLOAD events call functions that depend upon the XML, and so fail.
I thought the problem might be buffer-related, but having removed any Response.Flush and Response.End statement, the problem still persists. Does anyone know of a method that might allow me to delay the ONLOAD events until the XML has been received?
Any help would be greatly appreciated.
Thanks.
Basic structure of ASP page sent to client:
Code:
<html><head></head>
[javascript includes]
<body ONLOAD=loadwin()>
[More HTML]
</body></html>
<xml>
[XML stuff]
</xml>
The HTML and XML are both written by the same procedure at the server. However, although all of the HTML / XML is written synchronously, when the client receives the response, the HTML appears and begins to execute ONLOAD javascript functions before the accompanying XML appears.
Some of the ONLOAD events call functions that depend upon the XML, and so fail.
I thought the problem might be buffer-related, but having removed any Response.Flush and Response.End statement, the problem still persists. Does anyone know of a method that might allow me to delay the ONLOAD events until the XML has been received?
Any help would be greatly appreciated.
Thanks.