I have a parent window, from where I open the child window using window.open, as shown below. I want to get a boolean value from a child window, based on which I will perform my tasks in the parent window.
function openChildWin()
{
var childWin = window.open("childWin.html", "_blank", "height=400, width=550, status=yes, toolbar=no, menubar=no, location=no,addressbar=no);
if (childWin)
{
//some logic
}
else
{
//some logic
}
}
**childWin.html**
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
function OKClicked()
{
window.close();
}
</script>
</head>
<body>
<button type="button" id="OKButton" onclick="OKClicked()">Click ME</button>
</body>
</html>
When the button is pressed, I want to return true here. But all this does not work for me. Am I missing the syntax here?
user1556433
source
share