Possible Duplicate:
Playing sound with JavaScript
I’m making a javascript chat for my site and I need to play a sound when it has a new message and the chat is not focused, just like the Facebook’s chat. Problem is I have no clue how to play this sound in background with javascript. Could you help me?
Edit: Crossbrowser solutions without Flash will be better
You may use jQuery and it’s
appendfunction along with script;Create an element (example –
<div>) or use an existing element, and give it some id (like<div id="some_div">). Then try the below codeHope this helps…
:)