Home  >  Article  >  Web Front-end  >  Solution to the return value problem of modal dialog box showModalDialog in Chrome_javascript skills

Solution to the return value problem of modal dialog box showModalDialog in Chrome_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:26:371522browse

I haven't found a good solution. The temporary solution is to assign the return value to window.opener.ReturnValue in the pop-up window at the same time. In this way, after closing the window, the return value is obtained through the following code:

Copy code The code is as follows:

var val = window.showModalDialog(...);
if(!val)
val= window.ReturnValue;

This way in IE, FF, and Chrome, You can get the return value.
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