---
title: "window.showModalDialog 的使用"
author: "q272156430"
date: "2010-03-20T11:04:33Z"
tags: []
categories: ["Web前端"]
slug: "window-showmodaldialog"
draft: false
lastmod: "2010-03-20T11:06:14Z"
id: 620319
url: "https://xiaolele.iteye.com/blog/620319"
---

```
父窗口
```

```
 var a =  window.showModalDialog('D:/bb.jsp',window,'dialogWidth:1000px;dialogHeight:500px;status=yes;scroll=yes;scrollbars=no;edge=sunken;resizable=yes;help=no');
  alert(a.name)//获取子窗口bb.jsp返回的值
```

  子窗口：bb.jsp

 

```
 var a=window.dialogArguments;
  window.returnValue={name:'xinag',age:1}; //返回父窗口的值
  window.close(); 
  //alert(a.document.getElementById("test_a").value)//获取父窗口的值
```