C
Christopher Benson-Manica
In the course of trying to solve the scrollbar problem in my previous
post, I came up with the following code. It works in that it changes
the scrolling attribute for the frame I'm interested in, but the new
problem is that Firefox and Netscape 7.1 reload the button frame (IE 6
does not). Since the real application behind this exercise involves
a frameset with three CGI's, it would be horrific to redundantly load
two CGI's simply to change the scrolling attribute of one of the
frames. SOMEONE SHOOT ME I'M IN HELL!! (help would be gratefully
accepted
<html>
<head>
<title>foo</title>
<script type="text/javascript">
var foo=true;
var frame;
var set;
function ready() {
frame=document.getElementById( 'mainFrame' );
set=document.getElementById( 'set' );
}
function toggle() {
foo=!foo;
document.documentElement.removeChild( set );
for( var idx=set.childNodes.length-1; idx >= 0; idx-- ) {
if( set.childNodes[idx].tagName != null && set.childNodes[idx].tagName.toUpperCase() == 'FRAME' ) {
set.removeChild( set.childNodes[idx] );
break;
}
}
var f=document.createElement( 'frame' );
f.src='foo.html';
f.scrolling= foo ? 'yes' : 'no';
set.appendChild( f );
document.documentElement.appendChild( set );
}
</script></head>
<frameset cols="50%,*" onload="ready()" id="set">
<frame src="button.html">
<frame id="mainFrame" src="foo.html" scrolling="yes">
</frameset></html>
post, I came up with the following code. It works in that it changes
the scrolling attribute for the frame I'm interested in, but the new
problem is that Firefox and Netscape 7.1 reload the button frame (IE 6
does not). Since the real application behind this exercise involves
a frameset with three CGI's, it would be horrific to redundantly load
two CGI's simply to change the scrolling attribute of one of the
frames. SOMEONE SHOOT ME I'M IN HELL!! (help would be gratefully
accepted
<html>
<head>
<title>foo</title>
<script type="text/javascript">
var foo=true;
var frame;
var set;
function ready() {
frame=document.getElementById( 'mainFrame' );
set=document.getElementById( 'set' );
}
function toggle() {
foo=!foo;
document.documentElement.removeChild( set );
for( var idx=set.childNodes.length-1; idx >= 0; idx-- ) {
if( set.childNodes[idx].tagName != null && set.childNodes[idx].tagName.toUpperCase() == 'FRAME' ) {
set.removeChild( set.childNodes[idx] );
break;
}
}
var f=document.createElement( 'frame' );
f.src='foo.html';
f.scrolling= foo ? 'yes' : 'no';
set.appendChild( f );
document.documentElement.appendChild( set );
}
</script></head>
<frameset cols="50%,*" onload="ready()" id="set">
<frame src="button.html">
<frame id="mainFrame" src="foo.html" scrolling="yes">
</frameset></html>