window.dialogArguments 使用说明

小云
101
2023-08-10 12:50:20
栏目: 智能运维

window.dialogArguments是一个只读属性,它返回打开当前窗口的窗口的参数。这个属性只在通过window.showModalDialog方法打开的模态对话框中才有值。

示例用法:

// 打开模态对话框
var dialogArgs = { name: "John", age: 30 };
var result = window.showModalDialog("dialog.html", dialogArgs);
// 在模态对话框中访问传递的参数
console.log(window.dialogArguments.name); // 输出 "John"
console.log(window.dialogArguments.age); // 输出 30

注意:window.showModalDialog方法目前已经被弃用,不推荐使用。

0
看了该问题的人还看了