By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,946 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,946 IT Pros & Developers. It's quick & easy.

How can I "BEEP" with javascript?

P: n/a
I have replaced all of my form checking alerts with a javascript routine
that writes the error message into the form above the field where the error
occurs.

I would like it to make a similar noise to the alert box though. Is there a
javascript command to make this noise? I do not want to be playing a sound
file from the server, just using the local client resources as the alert
does.

Any idea how to do this? I cannot find anything usefull by googling the
topic.

Thanks!
Jun 26 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Simon Wigzell said the following on 6/26/2006 11:18 AM:
I have replaced all of my form checking alerts with a javascript routine
that writes the error message into the form above the field where the error
occurs.
So far, so good. Change the colors and all is fine.
I would like it to make a similar noise to the alert box though.
You can't reliable do that in a cross-browser manner. You can do it in
IE but thats it (reliably).
Is there a javascript command to make this noise?
window.alert('You should hear the sound you have associated with alert')
I do not want to be playing a sound file from the server, just
using the local client resources as the alert does.
Then use an alert.
Any idea how to do this? I cannot find anything usefull by googling the
topic.


Nothing in Google about playing sounds with JS? I find that difficult to
believe. Especially if you searched the archives.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 27 '06 #2

P: n/a

Don't think so, just use a small .wav file, just a tiny 5kbs or so .wav file, just a 'beep',
and give it some loops effect if you want to get fancy, but a tiny .wav should do it just fine,
like http://www.irt.org/script/191.htm , that url is an old article, however, using <object>
or <embed> objects will still use .play() or .playPause() and .stop() OR .run() which is what
IE uses iirc. No dice on using the local speaker with some native event.
Danny
Jun 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.