Friday, December 30, 2011

Refreshing FRAME

FRAMEs are tricky in nature; it is advisable to avoid them. But in many scenarios you have no other choices but to deal with it. Here are some useful tips while handling a FRAME.

Creating a frameset

<html>
<head>
<title>Simple frames</title>
</head>
<frameset cols="250,*">
  <frame name="frmLeft" src="LeftPage.htm" />
  <frame name="frmRight" src="RightPage.htm" />
</frameset>
</html>

 

Refreshing one frame using JavaScript

parent.frames['frameName'].location.reload();

Replacing a specific frame using JavaScript

document.forms[0].target='_top';

Here index 0 indicates the first frame.

No comments: