from main.html, startA function will popup a page and from popup page,
it will return a value to main.htm and alert the variable aaa.
However, we know that window.open and alert always start at the same time and hence we never capture the return from popup, so I make a
prompt to stop the startA keep running so computer have time to capture
the return values from popup.
But how to make user keep focus on popup page until it close?
otherwise, before they return value from popup, they can see the prompt
and can start the alert immediately before value(aaa) to return.
help.
thanks.
main.html
-
-
function startA() {
-
-
window.open("popup.htm");
-
-
check=prompt("process?");
-
-
if (check) {
-
alert(window.aaa); //aaa is a variable return from popup page
-
}
-
popup.htm
- window.opener.aaa="okok";
}