![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to create dynamic iframe content like below but in Firefox iframe width="100%" height="100" src="#"></iframe script language="JavaScript"><!-- document.frames[0].document.open(); document.frames[0].document.write('THis is the dynamic text for iframe above'); document.frames[0].document.close(); //--></script these document.frames are now working under Firefox, can someone help me? |
#3
| |||
| |||
|
|
I want to create dynamic iframe content like below but in Firefox iframe width="100%" height="100" src="#"></iframe script language="JavaScript"><!-- document.frames[0].document.open(); document.frames[0].document.write('THis is the dynamic text for iframe above'); document.frames[0].document.close(); //--></script these document.frames are now working under Firefox, can someone help me? |
#4
| |||
| |||
|
|
mike888 (AT) berlin (DOT) com> wrote in message news:1161330157.801702.316250 (AT) e3g2000cwe (DOT) googlegroups.com... I want to create dynamic iframe content like below but in Firefox iframe width="100%" height="100" src="#"></iframe script language="JavaScript"><!-- document.frames[0].document.open(); document.frames[0].document.write('THis is the dynamic text for iframe above'); document.frames[0].document.close(); //--></script these document.frames are now working under Firefox, can someone help me? First, remove the width and height and let CSS format the inline frame. Assign a unique ID for the element. iframe id="myFrame" src=""> </iframe Now in the stylesheet you can reference the element's ID with: #myFrame { position: relative; width: 100%; height: 100%; } Next in your JavaScript use: document.getElementById('myFrame').innerHTML "This is the dynamic text for the iframe."; The original purpose of an inline frame was to embed other html documents within the parent document. I think you are trying to do something different. If you are simply wanting to display textual content I suggest using a div in the same manner as described above. If you want it to work with older browsers then you need to do a little browser sniffing via the document's onload() event and check for rendering class and version. Create code specific to each group of browsers. My code example works with the later versions of Opera, Netscape, MSIE, Mozilla and FireFox (same engine as NS). Mark |
![]() |
| Thread Tools | |
| Display Modes | |
| |