Netscape 7.1 and IFrames/ILayers Src

S

Scott

Hello All,

I've been reading all of the various issues with Iframes in netscape.
I have tried all of the various fixes posted, and have even
implemented both an iframe and ilayer. My problem is that no matter
which i use, i can access the src before and after i change it, but
the page never displays. in IE6 it works no matter how i access it.
here is the code that is changing it:

function InternalNav(sPage) {
//this is called only by clicking a link on the page, no outside will
use this
//first see if the page is the home page...
if (sPage =="home") {
document.getElementById("Content").style.display="none";
document.getElementById("ContentNet").style.display="none";
document.getElementById("Main").style.display="";
}
else {
if (document.all) {
document.getElementById("Content").style.display="";
}
else {
document.getElementById("ContentNet").style.display="";
}
document.getElementById("Main").style.display="none";
}

//navigate the iframe
var sURLSrc = "";
sURLSrc = sPage + ".htm";
alert(document.getElementById("ContentFrameNet").src);
if (document.getElementById("ContentFrameNet")) {
document.getElementById("ContentFrameNet").src = sURLSrc;
alert(document.getElementById("ContentFrameNet").src);
}
else {
document.layers["ContentFrame"].load(sPage + ".htm",100);
}
//change the images
TurnOffImages(sPage);
return;

}
'=====================================================
here is the code for the iframe/ilayer

<p id="Main" style="display:">
Main Content Here
</p>
<p id="Content" style="display: none">
<iframe align="top" frameborder="0" id="ContentFrame"
name="ContentFrame" src="untitled.htm" scrolling="auto" width="100%"
height="100%"></iframe>
</p>
<p id="ContentNet" style="display: none">
<ilayer top="0" left="0" visibility="show" src="untitled.htm"
width="100%" height="100%"></ilayer>
</p>
'===========================================================

any help would be greatly appreciated.

tia

Scott
 
V

VK

A common mistake:
ILAYER has nothing to do with inline frames, despite it sounds "in the same
pattern" (this must be the reason of the mistake).
ILAYER was intended in ancient Netscapes (4.xx) to wrap a part of the
current content to move it relatively the place where such content would be
placed "by itself". ILAYER doesn't recognize mouse event and it doesn't
support .src property.
If you want to keep supporting legacy browsers, use <layer> (w/o "i")
 
D

DU

Scott said:
Hello All,

I've been reading all of the various issues with Iframes in netscape.

Have you?

Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-developer/upgrade_2.html
I have tried all of the various fixes posted,

Have you?

Fixes posted are always about specific pages, defined issues, identified
problems. Some address general issues but most of the time posts in this
newsgroup are about specific, defined, identified webpage contexts,
precise questions.

and have even
implemented both an iframe and ilayer.

"Because layers are not part of any W3C web standard, Netscape 6/7 and
Mozilla do not support layers. Like any other browser that doesn't
support layers, Gecko renders the HTML as if the LAYER, ILAYER, and
NOLAYER tags were not there."
http://www.mozilla.org/docs/web-developer/upgrade_2.html#layer

Updating DHTML Web Pages for next generation browsers
http://devedge.netscape.com/viewsource/2001/updating-dhtml-web-pages/#Tags Support
http://devedge.netscape.com/viewsource/2001/updating-dhtml-web-pages/#update-markup

My problem is that no matter
which i use, i can access the src before and after i change it, but
the page never displays. in IE6 it works no matter how i access it.
here is the code that is changing it:

function InternalNav(sPage) {
//this is called only by clicking a link on the page, no outside will
use this
//first see if the page is the home page...
if (sPage =="home") {
document.getElementById("Content").style.display="none";

If your "Content" div is set to be not displayed, then changes will
never be viewable.
document.getElementById("ContentNet").style.display="none";
document.getElementById("Main").style.display="";
}
else {
if (document.all) {

Right here, you're forking your code to support MSIE browsers and those
who supported document.all. So, you will end up with a different working
page depending on the browser visiting that page.
document.getElementById("Content").style.display="";
}
else {
document.getElementById("ContentNet").style.display="";

Since NS 7.1 does not support document.all, the code will be directed to
this line... and "ContentNet" is the paragraph with the ilayer
element... which we know is not supported by NS 7.1. So...
}
document.getElementById("Main").style.display="none";
}

//navigate the iframe
var sURLSrc = "";
sURLSrc = sPage + ".htm";
alert(document.getElementById("ContentFrameNet").src);
if (document.getElementById("ContentFrameNet")) {
document.getElementById("ContentFrameNet").src = sURLSrc;

I cannot find any element with the id "ContentFrameNet" in your provided
code, so there is nothing I can propose here.
alert(document.getElementById("ContentFrameNet").src);
}
else {
document.layers["ContentFrame"].load(sPage + ".htm",100);
}

This part should have been for NS 4 since it refers to document.layers
but on the other hand it refers to a named iframe. So, this will never work.
//change the images
TurnOffImages(sPage);
return;

}
'=====================================================
here is the code for the iframe/ilayer

<p id="Main" style="display:">
Main Content Here
</p>
<p id="Content" style="display: none">
<iframe align="top" frameborder="0" id="ContentFrame"
name="ContentFrame" src="untitled.htm" scrolling="auto" width="100%"
height="100%"></iframe>

You're giving the same identifier to your name and id attributes. This
is not recommendable for various reasons (debugging, intuitive code,
etc.). How about id="Iframe_id" and name="Iframe_Name"?
</p>
<p id="ContentNet" style="display: none">
<ilayer top="0" left="0" visibility="show" src="untitled.htm"
width="100%" height="100%"></ilayer>
</p>
'===========================================================

any help would be greatly appreciated.

tia

Scott


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 
D

DU

VK said:
A common mistake:
ILAYER has nothing to do with inline frames, despite it sounds "in the same
pattern" (this must be the reason of the mistake).
ILAYER was intended in ancient Netscapes (4.xx) to wrap a part of the
current content to move it relatively the place where such content would be
placed "by itself". ILAYER doesn't recognize mouse event and it doesn't
support .src property.
If you want to keep supporting legacy browsers, use <layer> (w/o "i")

Can you show me any documentation, reference, ..anything.. where it says
that <layer> is supported by NS 6.x or NS 7.x?

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 
D

Dom Leonard

Scott said:
Hello All,

I've been reading all of the various issues with Iframes in netscape.
I have tried all of the various fixes posted, and have even
implemented both an iframe and ilayer. My problem is that no matter
which i use, i can access the src before and after i change it, but
the page never displays.

<snip>

There are various problems with IFRAMES under Mozialla/Netscape. For
example forms are not submitted from within iframes with "display:none".
So usage of "display:none" would be my first suspect - updating .src
worked for me on a visible IFRAME but failed for one hidden inside
"display:none".

As others have mentioned, ILAYER and document.layers are specific to
NS4. Since NS4.xx does not support document.getElementById or IFRAME
elements, there appears to be little point of pursuing NS4 support
within the envelope of the code posted.

To compound the problem, NS4 will happily, but irreversibly, process the
"display:none" style property value of the container paragraph, so
supplying a "click here to visit" link between start and end IFRAME tags
for use in browsers without IFRAME support won't be rendered. I believe
there are hacks available on CSS newsgroups to supply CSS styling which
is not recognised by Netscape 4, but this would still leaves hanging how
the page would behave in current browsers with javascript disabled.

Sorry about the bad news - please don't shoot the messenger :)

HTH,

Dom
 
S

Scott

thanks for the pointers DU, but still the question remains, that since
I was originally using a standard iframe to support the new browsers,
as your mozilla link recommends, why doesn't the page ever show in
netscape? i have used

frame['name'].src
frame['name'].location.href/reload

i change the setting for content div tag to visible prior to the src
change, and even if it is visible by default it doesn't show.



DU said:
Scott said:
Hello All,

I've been reading all of the various issues with Iframes in netscape.

Have you?

Using Web Standards in Your Web Pages
http://www.mozilla.org/docs/web-developer/upgrade_2.html
I have tried all of the various fixes posted,

Have you?

Fixes posted are always about specific pages, defined issues, identified
problems. Some address general issues but most of the time posts in this
newsgroup are about specific, defined, identified webpage contexts,
precise questions.

and have even
implemented both an iframe and ilayer.

"Because layers are not part of any W3C web standard, Netscape 6/7 and
Mozilla do not support layers. Like any other browser that doesn't
support layers, Gecko renders the HTML as if the LAYER, ILAYER, and
NOLAYER tags were not there."
http://www.mozilla.org/docs/web-developer/upgrade_2.html#layer

Updating DHTML Web Pages for next generation browsers
http://devedge.netscape.com/viewsource/2001/updating-dhtml-web-pages/#Tags Support
http://devedge.netscape.com/viewsource/2001/updating-dhtml-web-pages/#update-markup

My problem is that no matter
which i use, i can access the src before and after i change it, but
the page never displays. in IE6 it works no matter how i access it.
here is the code that is changing it:

function InternalNav(sPage) {
//this is called only by clicking a link on the page, no outside will
use this
//first see if the page is the home page...
if (sPage =="home") {
document.getElementById("Content").style.display="none";

If your "Content" div is set to be not displayed, then changes will
never be viewable.
document.getElementById("ContentNet").style.display="none";
document.getElementById("Main").style.display="";
}
else {
if (document.all) {

Right here, you're forking your code to support MSIE browsers and those
who supported document.all. So, you will end up with a different working
page depending on the browser visiting that page.
document.getElementById("Content").style.display="";
}
else {
document.getElementById("ContentNet").style.display="";

Since NS 7.1 does not support document.all, the code will be directed to
this line... and "ContentNet" is the paragraph with the ilayer
element... which we know is not supported by NS 7.1. So...
} document.getElementById("Main").style.display="none";
}

//navigate the iframe
var sURLSrc = "";
sURLSrc = sPage + ".htm";
alert(document.getElementById("ContentFrameNet").src);
if (document.getElementById("ContentFrameNet")) {
document.getElementById("ContentFrameNet").src = sURLSrc;

I cannot find any element with the id "ContentFrameNet" in your provided
code, so there is nothing I can propose here.
alert(document.getElementById("ContentFrameNet").src);
}
else {
document.layers["ContentFrame"].load(sPage + ".htm",100);
}

This part should have been for NS 4 since it refers to document.layers
but on the other hand it refers to a named iframe. So, this will never work.
//change the images
TurnOffImages(sPage);
return;

}
'=====================================================
here is the code for the iframe/ilayer

<p id="Main" style="display:">
Main Content Here
</p>
<p id="Content" style="display: none">
<iframe align="top" frameborder="0" id="ContentFrame"
name="ContentFrame" src="untitled.htm" scrolling="auto" width="100%"
height="100%"></iframe>

You're giving the same identifier to your name and id attributes. This
is not recommendable for various reasons (debugging, intuitive code,
etc.). How about id="Iframe_id" and name="Iframe_Name"?
</p>
<p id="ContentNet" style="display: none">
<ilayer top="0" left="0" visibility="show" src="untitled.htm"
width="100%" height="100%"></ilayer>
</p>
'===========================================================

any help would be greatly appreciated.

tia

Scott


DU
 
D

Dom Leonard

DU said:
You're giving the same identifier to your name and id attributes. This
is not recommendable

Are you sure about this? My reading of the HTML 4.01 specification
indicates they must be the same:

<cite W3C HTML 4.01 recommendation, section 12.2.3>

It is permissible to use both attributes to specify an element's
unique identifier for the following elements: A, APPLET, FORM, FRAME,
IFRAME, IMG, and MAP. When both attributes are used on a single element,
their values must be identical.

</cite>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top