Re: NN workaround for iframe?

by =?iso-8859-1?Q?St=E9phane?= Bergeron <stephberg(at)videotron.ca>

 Date:  Sat, 26 Aug 2000 15:55:48 -0400
 To:  hwg-techniques(at)hwg.org
 Cc:  lead(at)sunshineband.org
 References:  0
  todo: View Thread, Original
At 10:15 AM 26/08/00 -0500, you wrote:
>Is there such an animal? I have a situation for which iframes is the ideal
>solution, but I MUST be able to support NN users as well. Does NN offer
>something equally proprietary and useful?

Actually, IFRAME is a perfectly valid element in the HTML 4.0 & 4.01 W3C=20
specs.  IE was the first to support it (and MS did come up with it) but=20
it's not proprietary.  Netscape 6.0 (PR2 here) and Opera 4.0x support it=20
and IE has supported it since IE 3.0x I believe.  The NS 4.x proprietary=20
equivalent is ILAYER.  You should insert the ILAYER tags inside the opening=
=20
and closing IFRAME tag and IE, NN 6 and Opera will read the IFRAME info and=
=20
ignore ILAYER while NN 4.x will read the ILAYER info and ignore the IFRAME=
=20
tag.  I experimented with that a while back following someone else's=20
question here and it worked fine.

>And yes, I know, there's a risk of excluding other or older browsers, but
>for this particular task I need only support the latest few versions of NN
>or IE.

You don't have to exclude older browsers either as you can insert alternate=
=20
content inside the opening and closing ILAYER tags and older browsers will=
=20
display that.  If you put the alternate content inside the IFRAME tags but=
=20
outside the ILAYER tags NS 4.x will display it anyway.  Can't wait for that=
=20
browser to be put out of its misery...  In any case, this technique works=20
very well right now in all current browsers and degrades well to older=20
browsers.  The code you should use looks something like this:

<.iframe src=3D"iframe_insert.html" name=3D"Insert" id=3D"Insert"=
 width=3D"300"=20
height=3D"300" align=3D"middle" scrolling=3D"yes" frameborder=3D"0">

<.ilayer name=3D"Insert" width=3D"300" height=3D"300"=
 src=3D"ilayer_insert.html">

Your browser doesn't support inline frames.

</ilayer>

</iframe>

Both the IFRAME and ILAYER tags have additional attributes not shown here=20
but that's a good start.

IE 3, 4 , 5 and 5.5 as well as NS 6 and Opera 4.0x will display the=20
document specified in the IFRAME src attribute and NS 4.x will display the=
=20
document specified in the ILAYER attribute (they're different here only for=
=20
experimentation's sake).  Other browsers such as NS 3.0x will display the=20
alternate content.  It works very well.

HTH!

St=E9phane Bergeron

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA