I have a parent window from where I am opening a child window using window.open like following. I want to get a boolean value from the child window on the basis of which I will do my tasks in 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()
{
//return true; //I want to return true here
window.close(); //Close this child window
}
</script>
</head>
<body>
<button type="button" id="OKButton" onclick="OKClicked()">Click ME</button>
</body>
</html>
When the button is clicked I want to return true from here. But all this is not working for me. Am I lacking syntax here?