| |

VerySource

 Forgot password?
 Register
Search
View: 759|Reply: 2

The value of returnValue in the unload event cannot be obtained by the parent window

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-17 21:30:01
| Show all posts |Read mode
In the opened window
window.unload ()
{
  returnValue = "true";
}

In parent window
var ret = window.showModalDialog ();
alert (ret);
The ret value is not "true", but is undefined.
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-26 10:00:02
| Show all posts
It should not be such a process, it should be:
Assign value to returnValue in the onload of the window, and then assign the value to the corresponding button or elsewhere. For example, it is equal to false when onload, and true otherwise, so that the return value is guaranteed to be flase when the user has no choice.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-4-26 18:45:01
| Show all posts
returnValue =>
window.returnValue
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list