When frames reload

  • Thread starter Christopher Benson-Manica
  • Start date
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>
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top