父窗口:windowdemo.html

<html>

<head>

<title> 接收子窗口返回的内容 </title>

<script language="JavaScript">

function shownewpage(thisurl)

{ window.open('content.html','content','width=480,height=330,top=150,left=280, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no'); }

</script>

</head>

<body> <form action="" method="post" name="parentform"> <input type="button" value="选择信息" onclick="shownewpage('content.html');"> <br> 选择的结果:<input type="text" name="result"/>

</form>

</body>

</html>

 

子窗口: cntent.html

<html>

<head>

<title>返回内容 </title>

<script language="JavaScript">

function returnValue()

{  var city=document.myform.city.value var doc=window.opener.document; doc.parentform.result.value=city; window.close(); }

</script>

</head>

<body>

<form name="myform" >

选择:

<select name="city">

<option value="北京">北京</option>

<option value="天津">天津</option> </select>

<input type="button" value="返回" onclick="returnValue()">

</form> </body> </html>

 

相关文章:

  • 2022-02-08
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
猜你喜欢
  • 2021-06-30
  • 2021-09-29
  • 2021-11-10
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-08-10
相关资源
相似解决方案