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>
Member Avatar for LastMitch

This chat sound notification script works on Internet Explorer, Safari and google chrome.

@mutago

I think you forgot or missing an important information.

What player are you using?

Is this a HTML5 player?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.