a.html中打开一个新页面b.html,b.html页面给a.html中的input传一个值并将value赋给input框。
a.html:
<html>
<head>
<script>
window.onload=c;
var str;
function c(){
str =window.showModalDialog("b.html","","dialogHeight=600px;dialogWidth=1000px;");
document.getElementById("aa").value=str;
}
</script>
</head>
<body>
<input id="aa" type="text" value=""/>
</body>
</html>
b.html:
<html>
<head>
<script>
window.returnValue="hello world!";
</script>
</head>
<body>
b.html
</body>
</html>