home.html<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<iframe frameborder="1" id="FrmRight" name="right" scrolling="auto" src="Call.html"></iframe>
</body>
</html>Call.html<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
var temp="";
function btnClick()
{
var str=document.getElementById("col").value;
if(str=="")
{
alert("请输入");
document.getElementById("col").focus();
return;
}
temp=str;
window.open("Caller.html","_self");
}
</script>
</head><body>
请输入颜色
<input type="text" id="col" />
<input type="button" id="C" value="Call" onclick="btnClick()" />
</body>
</html>Caller.html<body>
<input type="text" id="co" />
<input type="button" id="a" value="Caller" />
</body>
</html>
<script type="text/javascript">
alert(window.opener.location);
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<iframe frameborder="1" id="FrmRight" name="right" scrolling="auto" src="Call.html"></iframe>
</body>
</html>Call.html<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
var temp="";
function btnClick()
{
var str=document.getElementById("col").value;
if(str=="")
{
alert("请输入");
document.getElementById("col").focus();
return;
}
temp=str;
window.open("Caller.html","_self");
}
</script>
</head><body>
请输入颜色
<input type="text" id="col" />
<input type="button" id="C" value="Call" onclick="btnClick()" />
</body>
</html>Caller.html<body>
<input type="text" id="co" />
<input type="button" id="a" value="Caller" />
</body>
</html>
<script type="text/javascript">
alert(window.opener.location);
</script>
var temp="";
function btnClick() {
var str=document.getElementById("col").value;
if(str=="") {
alert("请输入");
document.getElementById("col").focus();
return;
}
temp=str;
window.open("Caller.html?"+document.location.href,"_self"); }
</script>caller.html里面<script type="text/javascript">
var str = window.location.href.split("?")
alert(str[1]);
</script>
var DllPath = top.g_sBinSign;
var Tab_DBName = oTab.sName;
var strModal = new Array(Tab_DBName,DllPath);
var strReturn = window.showModalDialog("AddDataBase.htm",strModal,"font-size:12px;dialogWidth:28em;dialogHeight:32em;center:yes;help:no;status:no;scroll:no");
var strModal = window.dialogArguments;为什么window.open()不能像window.showModalDialog()这样,可以直接把参数传到下一页呢?
直接调用那个方法就可以简单的传值 打开新窗口 规定大小 内容颜色等等
还有一种方法就是,在框架页定义一个变量,在call.htm页面赋值,在caller.htm页面读取,这种方法我还没试过,大家可以试试看!