87,921
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<script>
function setValue(){
var ret = window.showModalDialog("b.htm",'','');
document.getElementById("txt1").value=ret[0];
}
</script>
</head>
<body>
<input type=text value="" id=txt1 readonly>
<input type=button onclick=setValue() value="set value">
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>b</title>
<script>
function on_submit(){
window.returnValue=[document.getElementById("txt2").value,document.getElementById("txt3").value,document.getElementById("txt4").value];
window.close();
}
</script>
</head>
<body>
<input type="text" value="" id="txt2">
<input type="text" value="" id="txt3">
<input type="text" value="" id="txt4">
<input type=button value=submit onclick="on_submit()">
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function openPage(page){
var arg = {
window: window,
input: document.getElementById('input')
};
//window.showModelessDialog(page, arg, 'status:no;edge:sunken;dialogWidth:600px;dialogHeight:350px');
window.showModalDialog(page, arg, 'status:no;edge:sunken;dialogWidth:600px;dialogHeight:350px');
}
</script>
</head>
<body>
<a hre="#" onclick="openPage('input.html');" style="cursor:hand">open</a>
<textarea id="input"></textarea>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
var arg = window.dialogArguments;
window.onload =function(){
var done = document.getElementById('done'),
input = document.getElementById('input');
done.onclick = function(){
arg.input.value = input.value;
}
}
</script>
</head>
<body>
<textarea id="input"></textarea>
<input type="button" id="done" value="done" />
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<script>
function setValue(){
var ret = window.showModalDialog("b.htm",'','');
document.getElementById("txt1").value=ret;
}
</script>
</head>
<body>
<input type=text value="" id=txt1 readonly>
<input type=button onclick=setValue() value="set value">
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>b</title>
<script>
function on_submit(){
window.returnValue=document.getElementById("txt2").value;
window.close();
}
</script>
</head>
<body>
<input type="text" value="" id="txt2">
<input type=button value=submit onclick="on_submit()">
</body>
</html>