kurt <pe******@SPAMGUARDrocketmail.com> wrote in message news:<eq********************************@4ax.com>. ..
greetings,
I'm working on a bookmarklet that needs to overwrite the current
document with a frameset where the src of one of the frames is the
current URL.
I was able to get what you requested working in Netscape 7.2 too, but
not in IE 5.2.
I tried several approaches which are coded in frame2.html. I made a
button for each approach that I tried.
Maybe what I tried will be of some help to someone else figuring out
if this request is possible.
Robert
frames.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frames Layout</title>
</head>
<frameset id="frameSetId" rows="50%,50%" border="0" frameborder="no" >
<frame src="frame1.html"
id="myframe1"
name="nameframe1"
scrolling=yes>
<frame src="frame2.html"
id="myframe2"
name="nameframe2"
scrolling=yes>
</frameset>
</html>
frame1.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frame 1</title>
</head>
<body>
<p>This is frame 1.</p>
</body>
</html>
frame2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Frame 2</title>
<script type="text/javascript">
function resizeFrame(percent)
{
var node = top.document.getElementById("frameSetId");
node.rows = percent;
}
function fullSize()
{
top.location.href = "frame1.html";
}
</script>
</head>
<body>
<p>This is frame 2.</p>
<form>
<input type="button"
name="activate"
value="Both frames at 50%."
onclick="resizeFrame('50%,50%');">
<input type="button"
name="activate"
value="Enlarge upper frame to 75%."
onclick="resizeFrame('75%,20%');">
<input type="button"
name="activate"
value="Enlarge upper frame to 100%."
onclick="resizeFrame('100%,0%');">
<br>
<input type="button"
name="activate"
value="display only frame1.html"
onclick="fullSize();">
<br><br>
</form>
<a href="frame1.html" target="_top">Link only to frame1.html</a>
</body>
</html>