JS-模态窗口的使用
<script type="text/javascript">
function showDiglog(){
var array = [1,2,3];
var x = window.showModalDialog("second.html",array);
//这里阻塞,直到弹出的模态窗口被手动关闭
alert(x);
}
</script>
<input type="button" value="click" onclick="showDiglog()"/>
<script type="text/javascript">
var args = window.dialogArguments;
if (args != null) {
for ( var i = 0; i < args.length; i++) {
document.writeln(args[i] + " " + (i + 1) * 10);
}
} else {
document.writeln("对不起,参数为空");
}
//向父窗口返回的值
window.returnValue = "这是子窗口返回来的值";
</script>