Showing posts with label document.getElementById().innerHTML. Show all posts
Showing posts with label document.getElementById().innerHTML. Show all posts

HTML Page Loading Sequence

HTML page loading sequence is to load head first, then body, then window.onload event. If one use document.write() to write DHTML and for which the value is to be assigned by window.onload event, it will be failed because HTML body would be loaded before window.onload event. That is why in DHTML, document. getElementById().innerHTML is preferred in comparison to document.write().

When HTML head being loaded, sequentially it loads external JavaScript files. If more than one JS files exist, be careful the sequence; because for functions have not loaded yet, but called by window.onload, an error will occur.

Use getElementById().innerHTML in DHTML

In comparison with document.write(), document. getElementById().innerHTML is very useful because it can be changed after load. However, it cannot be used to insert a row in the table. To do it, it is suggested to insert a complete inner table. Yes, frame your row by an inner table within the table.

Labels