Home  >  Article  >  Web Front-end  >  window.returnValue使用方法示例介绍_javascript技巧

window.returnValue使用方法示例介绍_javascript技巧

WBOY
WBOYOriginal
2016-05-16 16:42:391183browse

window.showModalDialog是弹出模式窗口的方法

returnValue是javascript中html的window对象的属性,目的是返回窗口值,当用window.showModalDialog函数打开一个IE的模式窗口(模式窗口知道吧,就是打开后不能操作父窗口,只能等模式窗口关闭时才能操作)时,用于返回窗口的值,下面举个例子:

1、parent.html

//father.html 
 
 
 
 
 

 

 
 
 

2、child.html

//child.html 
 
 
 
 
 

 
 

 
 

 

总结:

这样一来可以实现从模式窗口向父窗口传递值的作用,这个returnValue除了可以是布尔值,整型值等以外还可以是个js数组,用来传递大量数据。

具体showModalDialog等的用法,可以参考msdn。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn