bganonymous
Registered
Искам следния код: Цъкам на бутон, отваря се прозорче, и след затварянето му - на екрана се изписва текст: "Успешно!".
Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<!DOCTYPE html>
<html>
<head>
<title> WT - bganonymous</title>
<meta charset="UTF-8">
</head>
<body>
<button id="btn">Клик</button>
<script type="text/javascript">
window.onload = function () {
var elButton = document.querySelector('#btn');
elButton.addEventListener('click', function (e) {
e.preventDefault();
var popup = window.open("", "", "width=200, height=100");
popup.addEventListener('beforeunload', function (e) {
alert('Успешно');
/*window.setTimeout(function () {
window.location = 'http://google.bg';
}, 50);*/
});
});
};
</script>
</body>
</html>