Created
October 10, 2015 14:19
-
-
Save suissa/5c068cd44a42cef8585e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Notifier</title> | |
<script> | |
function notify(text){ | |
document.getElementById('msg').innerHTML+='<p>'+text+'</p>' | |
titleFlick() | |
} | |
function titleFlick(){ | |
if(document.hasFocus()){ | |
document.title='Notifier' | |
return | |
} | |
document.title=document.title=='Notifier'?'* Notifier':'Notifier' | |
setTimeout('titleFlick()',500) | |
} | |
</script> | |
</head> | |
<body> | |
<input type="button" id="notify" value="Notify in 5 seconds" | |
onclick="notify('Irá notificar em 5 segundos...');setTimeout('notify(\'Eventoo!\')',5000)" /> | |
<div id="msg"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment