新闻资讯

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻资讯列表

window.dialogArguments 使用说明,window.dialogarguments未定义

发布时间:2023-08-14 08:35:03

window.dialogArguments 使用说明

window.dialogArguments是一个只读属性,它返回打开当前窗口的窗口的参数。这个属性只在通过window.showModalDialog方法打开的模态对话框中才有值。
示例用法:
```javascript
// 打开模态对话框
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方法目前已被弃用,不推荐使用。