Deferring script execution can sometimes get round some tricky problems with accessing a page before it is ready. There are certain stages that the page object model undergoes which are not apparent from the outside.
For example, when loading a page a complex object hierarchy needs to be built. That is not going to be complete until the closing </BODY> tag is encountered. Before that time, certain objects may be accessed but others may not. For instance, prior to the body closure, you cannot use a document.write() to insert an ActiveX <OBJECT> tag using inline coding techniques. You can do a <DIV> block replacement when the body has closed but an error results if you try to do this too soon.
See also: | XML.defer |
Prev | Home | Next |
SCRIPT.charset | Up | SCRIPT.event |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |