Suppose I have one html page with frames. The left frame is simply a list of links, which will be displayed in the right frame. Is it possible, using javascript, to generate the contents of the left frame when the page loads?
+1
A:
Sure. You can use javascript's document.write()
or (as I prefer to) keep an empty container (DIV) on the left frame and inject your HTML into its innerHTML
property (also via javascript).
Kon
2008-11-11 15:49:43
+1
A:
parent.frameName.document.body would be the body-element of that frame, you can either use DOM-methods ( .createElement, .appendChild, .insertBefore) or .innerHTML to populate the frame with content.
jishi
2008-11-11 15:52:21