87,924
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script language="JavaScript">
function openDlg(){
var ret = showModalDialog("dialog.html");
if (ret) {
var obj = document.getElementById("div1");
strHtml = "<table border='1'>";
strHtml += "<tbody>";
strHtml += "<tr>";
for (o in ret) {
strHtml += "<td>" + ret[o] + "</td>";
}
strHtml += "</tr>";
strHtml += "</tbody>";
strHtml += "</table>";
obj.innerHTML = strHtml;
}
}
</script>
<body>
<input type="button" value="open dialog" onclick="openDlg()">
<div id="div1">
</div>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script language="JavaScript">
function doRet(){
var retVal = {};
retVal.x = document.getElementById("x").value;
retVal.y = document.getElementById("y").value;
retVal.z = document.getElementById("z").value;
returnValue = retVal;
close();
}
</script>
<body>
<input type="text" id="x" value="">
<input type="text" id="y" value="">
<input type="text" id="z" value="">
<input type="button" value="return" onclick="doRet();">
</body>
</html>