mutago
10-02-2013, 05:52 PM
This chat sound notification script works on Internet Explorer, Safari and google chrome.
But does not work on mozila firefox. can someone help me to fix that or an alternative that can work in all browsers
<html><head></head>
<script type="text/javascript">
var soundObject = null;
function PlaySound() {
if (soundObject != null) {
document.body.removeChild(soundObject);
soundObject.removed = true;
soundObject = null;
}
soundObject = document.createElement("embed");
soundObject.setAttribute("src", "notify.wav");
soundObject.setAttribute("hidden", true);
soundObject.setAttribute("autostart", true);
document.body.appendChild(soundObject);
}
</script>
<body>
<embed src="notify.wav" autostart=false width=0 height=0 id="boom"
enablejavascript="true">
</form method="post" action="dd.php">
<input name="message" type="text" placeholder="Chatting" />
<input name="reciever" type="hidden" value=""><br>
<input name="submit" type="submit" value=Chat3 id="post_button" onClick="PlaySound()"/>
</form>
</body>
</html>
But does not work on mozila firefox. can someone help me to fix that or an alternative that can work in all browsers
<html><head></head>
<script type="text/javascript">
var soundObject = null;
function PlaySound() {
if (soundObject != null) {
document.body.removeChild(soundObject);
soundObject.removed = true;
soundObject = null;
}
soundObject = document.createElement("embed");
soundObject.setAttribute("src", "notify.wav");
soundObject.setAttribute("hidden", true);
soundObject.setAttribute("autostart", true);
document.body.appendChild(soundObject);
}
</script>
<body>
<embed src="notify.wav" autostart=false width=0 height=0 id="boom"
enablejavascript="true">
</form method="post" action="dd.php">
<input name="message" type="text" placeholder="Chatting" />
<input name="reciever" type="hidden" value=""><br>
<input name="submit" type="submit" value=Chat3 id="post_button" onClick="PlaySound()"/>
</form>
</body>
</html>