1.此问题涉及到两个页面
1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function closewindow(){
window.returnValue="1234";
window.close();
}
</script>
</head>
<body>
<input type="button" name="button1" value="关闭" οnclick="closewindow()" />
</body>
</html>
2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
function openwindow(){
var b=window.showModalDialog( "1.html ","", "dialogWidth:400;dialogHeight:500 ");
alert(b);//此地方的值返回的是1234
}
</script>
</HEAD>
<BODY>
<input type="button" name="button" value="打开" οnclick="javascript:openwindow();"/>
</BODY>
</HTML>