Link to home
Start Free TrialLog in
Avatar of dban00b
dban00b

asked on

Javascript setInterval on a frameset

I have a frameset page that I would like to run the javascript function setInterval.

window.setInterval("reload('http://www.google.com')", 5000);
function reload(url) {
        window.frames['forum'].src=url;
}


But It doesn't work as I expect, nothing happens.  I've attached the whole page in case my problem is not limited to just the javascript, but somewhere else in the html.
What did I miss or do wrong?
Thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing Frame reload</title>
<script type="text/javascript">
// <![CDATA[
window.setInterval("reload('http://www.google.com')", 5000);
function reload(url) {
        window.frames['forum'].src=url;
}
 
// ]]>
</script>
</head>
 
<FRAMESET cols="*, 165">
  <FRAMESET rows="120, *">
      <FRAME frameborder="0" marginwidth="5" marginheight="5" border="0" src="header.html" name="main" />
      <FRAME frameborder="0" marginwidth="5" marginheight="5" border="0" src="forum.php" name="forum" />
  </FRAMESET>
  <frame frameborder="0" scrolling="no" noresize  marginwidth="7" marginheight="0" src="session.php" name="session" />
  <NOFRAMES></NOFRAMES>
</FRAMESET>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dban00b
dban00b

ASKER

Yup the problem was I can't do this from the frameset page, it has to be done from within the frame.
Thanks.