JS in HTML Frameset

P

Phrogz

I have a website with code like the following. I swear it used to work
2 years ago when first written. However, testing in both IE6SP2 and
Firefox 1.5 no longer seem to run the script at the top level of the
frameet.

Is there a way to run JS at the frameset level? (I want to us JS to
parse some querystrings passed to the frameset, and use those to pass
on to one child frame and change the href of the other child frame.)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
<title>Testing</title>
</head>
<frameset cols="220,*">
<frame src="t1.html" name="f1" id="f1">
<frame src="t2.html" name="f2" id="f2">
</frameset>
<script type="text/javascript">
alert( 'Yay!' );
</script>
</html>
 
P

Phrogz

Phrogz said:
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1">
<title>Testing</title>
</head>
<frameset cols="220,*">
<frame src="t1.html" name="f1" id="f1">
<frame src="t2.html" name="f2" id="f2">
</frameset>
<script type="text/javascript">
alert( 'Yay!' );
</script>
</html>

Nevermind, I validated my HTML (which I should have done before) and
see that script isn't legal there. I've changed it to:
<html><head>
....
<script type="text/javascript">
window.onload=function(){
....
}
</script></head><frameset>
....
</frameset></html>

And all is working as intended. Sorry for the noise.
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top