By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

JS in HTML Frameset

P: n/a
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>

Oct 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Phrogz wrote:
<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.

Oct 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.