IM Not programimng any WebSite, its for a PC software.
I have a software with free code, so what i bassicly what i wants is when “RegisterEvent(EVENT_GAMEMSG, quitfunc)” happens, goes to quitfunc
And quitfunc is:
function quitfunc(msg, type)
{
switch(type){
case 2:
if(msg.indexOf(msg) != -1){
**(HERE MUST COME AND ALERT CODE)**
}
break;
}
}
In (HERE MUST COME AND ALERT CODE) should replace with an Alert Code or a Beep Code or something
Any idea what i can do?
So the program does a Beep when the event happen, or maybe popout a windows alert or something?
You will need the sound in an audio file and have JavaScript add the <audio> tag to the page when you want the sound to play (and remove it again when you want the sound to stop playing).
alert is completely different – that’s a modal dialog in which you have to click “ok”, it’s very different from just making a beep sound.
That might be want the OP wants though, not sure. If a dialog is wanted, then yeah that would be simplest. But if it’s literally just the sound, then using audio would be better.
Using console.log() is better than using alert() - it doesn’t annoy your visitors asking them if they want to disable alerts or JavaScript if you forget to remove the debugging code before your script goes live.
Not all browsers display the extra checkboxes in alerts but alerts in live pages are as dead as Netscape 4 (the last browser that didn’t support updating the web page itself) and alerts were re-purposed for debugging use then. Since console.log() replaced it there has been no use for alert whatsoever and it should be considered obsolete since you have no control over how it looks and there are many alternatives available where you do have that control.