PDA

View Full Version : Accessing the frames collection in Netscape 6+


Running Bear
08-30-2002, 08:27 AM
I am trying the access the frames collection in netscape 6 can anyone help. IE5.5, 6 and NS4.7 all work okay.


<script language="JavaScript">
function reloadFrame() {
var ns4 = (document.layers);

if (ns4) { //if NS4
// Check if the frame exists. Reload the lefthand menu, else do nothing
if (parent.toc) {
parent.toc.location.href ='fcont_toc.asp'
}

}else {
// Check if the frame exists. Reload the lefthand menu, else do nothing
if (parent.frames('toc')) {
parent.frames('toc').location.href='fcont_toc.asp'
}

}
}
</script>

<body onload="reloadFrame()">



Thanks

Al

brothercake
08-30-2002, 12:03 PM
For Opera and Netscape 6 i've found the only 100% reliable method is to query objects as window.frames by index number, eg


window.frames[0]