两个文件,test.htm 和 lizi.htm
++++=================== test.htm =========
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="form1" method="post" action="">
<p>
<select name="select" onchange="window.open('lizi.htm')">
<option>1</option>
<option>2</option>
</select>
</p>
<p>
<input type="text" name="textfield">
</p>
</form>
<script>
var str=document.location.search
var str2=str.split("=")
document.form1.textfield.value=str2[1];
</script>
</body>
</html>========== lizi.htm ===========
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function test(){
opener.location.href=opener.location+"?form1="+document.form1.textfield.value
opener.location.reload()
self.close()
}
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<br>
<input type="submit" name="Submit" value="提交" onclick="test()">
</form>
</body>
</html>
++++=================== test.htm =========
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="form1" method="post" action="">
<p>
<select name="select" onchange="window.open('lizi.htm')">
<option>1</option>
<option>2</option>
</select>
</p>
<p>
<input type="text" name="textfield">
</p>
</form>
<script>
var str=document.location.search
var str2=str.split("=")
document.form1.textfield.value=str2[1];
</script>
</body>
</html>========== lizi.htm ===========
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function test(){
opener.location.href=opener.location+"?form1="+document.form1.textfield.value
opener.location.reload()
self.close()
}
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<br>
<input type="submit" name="Submit" value="提交" onclick="test()">
</form>
</body>
</html>
test.htm
===========
<script>
var str=document.location.search
if(str) {
var str2=str.split("=")
document.form1.textfield.value=str2[1];
}
</script>
我总算相同了
多谢net_lover(孟子E章)的提示。
我现在这样解决
<script>
function s(x)
{
opener.'||vElement||'.value = x
self.close()
opener.focus
}
</script>
v_postUrl为opener中的对象名字。
我用的是Oracle中plSql过程。动态生成javascript过程。
分只能给你了。
请问如何忽略
我在书上也看了例子,但说我语句有错。