faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 26 people (50%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How to make a page with iframes working in NN 4

Apr 26th, 2002 10:38
David Blackledge, Colin Fraser, Giovanni Santarelli,


Here's a short answer:
If you are just using the IFRAME to include content from another webpage 
(the usual use) you can do a "good enough" solution for N4 users by 
taking advantage of the N4 LAYER tag's SRC attribute to include the 
content:
<IFRAME SRC="mypage.html">
 <ILAYER SRC="mypage.html">
 </ILAYER>
</IFRAME>
Netscape 4 will ignore the IFRAME tag since it doesn't understand it and 
will perform the Layer functionality. Any browser that supports the 
IFRAME tag will ignore the content between the IFRAME
and /IFRAME tags. The results won't be identical, but they may suffice 
for your needs.
If you set ID attributes on the elements, then you can even access the 
included content's document in a similar way as well.
David.
http://David.Blackledge.com
--------------original/long_answer-----------------------------------
NN4.x does not support the IFRAME tag, that is a tag from the Dark Side 
and is only available in their IE. I dont know if NN6.x  does support 
the IFRAME tag, good if it does. Instead of using IFRAME, why not use a 
JavaScript that determines the browser and uses an if statement to 
either use an IFRAME or a popup based on the browser type. eg:
  if (navigator.appName=='Netscape') {
     myWin=window.open
     ("","displayWindow","menubar=no,scrollbars=no,
     status=no,width=250,height=300")
     myWin.document.write("<head><title>Netscape Browser PopUp Window 
     <\/title><\/head>")
     mywin.document.write("<body bgcolor=#ffffff>")
     mywin.document.write("<h1>This is my PopUp Window</h1>")
     mywin.document.write("Here goes nothing.")  
     }
  else {
     document.write("<IFRAME src="javascript.htm" scrolling="auto" 
     height="75%" width="60%" frameborder=1 marginwidth=1 marginheight=1 
     align="left"><\/IFRAME> ") //write the frame
     }
As usual, my secretary disavows all knowledge of this script. I dont 
know how this will go in a browser that is not ie or nn. 
As an alternate, you may want to try something like :
<html>
<head>
<STYLE TYPE="text/css">
  <!--
#parent1Div{position:absolute; left:0; top:0; width:800; height:600; 
clip:rect(0,800,600,0); }
#child1Div{position:absolute; left:30; top:40; width:250; height:100; 
clip:rect(0,250,100,0);}
#child2Div{position:absolute; left:140; top:170; width:150; height:60; 
clip:rect(0,150,60,0); }
#child3Div{position:absolute; left:70; top:350; width:280; height:240; 
clip:rect(0,280,240,0);}
#child4Div{position:absolute; left:20; top:570; width:80; height:20; 
clip:rect(0,80,20,0); }
  -->
  </STYLE>
</head>
<body link="#ffffff" vlink="#ffffee" alink="#ff0000" bgcolor="#ffffcc">
  <DIV ID="parent1Div">
<IMG src="bigimage.jpg" width="800" height="600">
          <DIV ID="child1Div">
           <font color="#ffff00">
             Part 1 : Layers and JavaScript<br>
             Part 2 : The Div Tag<br>
             Part 3 : IF..ELSE<br>
           Appendix :<br>
           </font>
        </DIV>
          <DIV ID="child2Div">
        <IMG src="smallimage.gif"> 
        </DIV>          
        <DIV ID="child3Div">
        <font color="#ffff00"><b>The background image lies in the parent 
layer. The text menu,  the graphic, the link prompt and this text all 
lie in four different, nested, layers.   The absolute positioning of 
each layer puts each element where I want it. </font></b>
        </DIV>
          <DIV ID="child4Div">
        <b><a href="prevpage.htm">Back</a></b>
        </DIV>
  </DIV>
</body>
</html>
This may be a far more appropriate outcome for what you want. Call it by 
just using a window opener script.