1.父窗口向子窗口传递参数:
function getQueryStr(sArgName)
{
var args = LocString.split("?");
var retval = "";
if(args[0] == LocString)
{
return retval;
}
var str = args[1];
args = str.split("&");
for(var i = 0; i < args.length; i ++)
{
str = args[i];
var arg = str.split("=");
if(arg.length <= 1) continue;
if(arg[0] == sArgName) retval = arg[1];
}
return retval;
}
var a=getQueryStr("a");
var b=getQueryStr("b");
var c=getQueryStr("c");
2.子页面向父页面传递参数:
3.父页面调用子窗口方法
4.子窗口调用父窗口方法
下面父窗口和子窗口相互调用举例:
<html>
<head>
<script
function say() {
function callChild()
{
}
</script>
</head>
<body>
<input
<iframe name="myFrame" src="child.html"></iframe>
</body>
</html>
子窗口页面
<html>
<head>
<script type="text/javascript">
function say()
{
}
function callParent() {
</script>
</head>
<body>
<input
</body>
</html>