Parent Window HTML
<!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>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<script language=”javascript”>
function parent_call()
{
alert(“I am your parent”);
}
function openme()
{
window.open (“file2.html”,”mywindow”,’height=200, width=200, resizable=no, scrollbars=no,toolbar=no,location=yes, directories=no, status=no, menubar=no, copyhistory=yes’);
}
</script>
</head>
<body>
<input type=”text” id=”parent_text” />
<input type=”button” value=”Open Child Window” onclick=”openme()” />
</body>
</html>
Child Window HTML
<!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>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<script language=”Javascript” type=”text/javascript”>
function updateParent_text()
{
window.opener.document.getElementById(“parent_text”).value = document.getElementById(“TextBox1″).value;
//return false;
}
function call_parent()
{
window.opener.parent_call();
//return false;
}
</script>
</head>
<body>
<input type=”text” id=”TextBox1″ />
<input type=”button” value=”Update Parent Text” onclick=”updateParent_text()” />
<input type=”button” value=”Call Parent Window” onclick=”call_parent()” />
</body>
</html>