在使用 window.showModalDialog
方法弹出模态对话框时,可以通过以下步骤处理返回值:
window.showModalDialog
方法时,可以传入一个参数用于指定返回值的键名,例如:var returnValue = window.showModalDialog("dialog.html", {}, "dialogWidth:500px; dialogHeight:300px");
window.returnValue
:window.returnValue = "value";
if (returnValue) {
console.log(returnValue);
}
需要注意的是,window.showModalDialog
方法已经被废弃,推荐使用 window.open
方法来替代。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>