Vincent van Beveren wrote:
I have the following (seemingly) useless piece of JavaScript
<html>
<head>
<script type="text/javascript">
function frameMe() {
s = "document.open();";
s += "document.writeln('<html><frameset
rows=\"*,33%\">');\n"; s += "document.writeln('<frame src=\"' + document.location +
'\">');\n";
s += "document.writeln('<frame src=\"about:blank\">');\n";
s += "document.writeln('</frameset></html>');\n";
eval(s);
}
</script>
</head>
<body>
<input type="button" onClick="frameMe();" value="Frame me! (again?)">
</body>
</html>
Now, in Firefox this works fine, but in IE, it doesn't. Does anyone
know why, and if it can be helped?
Thanks,
Vincent
Vincent,
Hmm...thats kinda neat....never thought of dynamically writing frames,
but it does seem to work. I worked out a way that works for firefox
and IE (see below). I tend to not like using frames since there are
usually other ways to do it without...but if you have some strange need
it could come in handy(I myself might have such a need). Eric
<html>
<head>
<script type="text/javascript">
function frameMe() {
document.write('<html><frameset rows=\"*,33%\"><frame name=\"main\"
src=\"net.htm\"><frame src=\"testme
..htm\"></frameset></html>');
window.frames.main.location="net.htm"
}
</script>
</head>
<body>
<input type="button" onClick="frameMe();" value="Frame me! (again?)">
</body>
</html>