Javascript模态对话框:取父页的值2011-01-271. a.htm 父页有 window.showModalDialog("b.htm");有 Html元素 <input type="text" id="t1" name="t1" value="value">2.b.htm 弹出页面能否在 b.htm 上取到 a.htm 中 t1的值 ?回答:在a.html中设置var results = window.showModalDialog("b.html");
if(results){
alert(results["key"]);
}在b.html中<script>
window.returnValue={
key:"返回到父页面"
}
</script>