Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<script>
var answer = "";
function popupMessage()
{
var popup = window.open("popup.html", "_new", "width=200,height=100");
if(popup) popup.focus();
}
function showAnswer()
{
alert("Answer is: " + answer);
}
</script>
</head>
<body>
<input type='button' value='Get Popup Answer' onclick='popupMessage()'/>
</body>
</html>
<html>
<head>
<title>Your answer requested</title>
<script>
function processAnswer(answer)
{
opener.answer = answer;
var o = opener;
this.opener = self;
window.close();
o.showAnswer();
}
</script>
</head>
<body background='Menu'>
Is this what you want?
<br />
<input type='button' value='Yes' onclick='processAnswer("Yes")' />
<input type='button' value='No' onclick='processAnswer("No")' />
</body>
</html>
<html>
<head>
<style>
.fakePopup
{
background-color:'Menu';
border-style:outset;
position:absolute;
}
</style>
<script>
var answer = "";
function popupMessage()
{
launchPopupButton.disabled = true;
var rightedge=document.body.clientWidth;
var bottomedge=document.body.clientHeight;
popup.style.left = rightedge/2 - popup.offsetWidth/2;
popup.style.top = bottomedge/2 - popup.offsetHeight/2;
popup.style.visibility = "visible";
popup.style.display = "inline";
}
function setAnswer(answerChosen)
{
answer = answerChosen;
popup.style.visibility = "hidden";
popup.style.display = "none";
alert("Answer is: " + answer);
launchPopupButton.disabled = false;
}
</script>
</head>
<body>
<input type='button' name='launchPopupButton' value='Get Popup Answer' onclick='popupMessage()'/>
<div class='fakePopup' id='popup' style='visibility:hidden;display:none'>
<center>
<b>Is this what you want?</b>
<br />
<br />
<input type='button' value='Yes' onclick='setAnswer("Yes")' />
<input type='button' value='No' onclick='setAnswer("No")' />
</center>
</div>
</body>
</html>