function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jagadeesh AdaveniJagadeesh Adaveni 

Need Error Sound when i am getting error on visualforce page


I have Apexpage messages in my controller, when my page message gets fired need some error sound.
How can i do this?
please give me any suggestions

Dario BakDario Bak
jQuery all the way. You should implement jquery in Salesforce first 

1) to use jquery in a VF page, check this:

2) to play sound with jQuery:

Create a button:
<div id="container">
            <button id="play">
                Play Music

Play the sound on click:
$('document').ready(function () {
    $('#play').click(function () {
        var audio = {};
        audio["walk"] = new Audio();
        audio["walk"].src = ""
        audio["walk"].addEventListener('load', function () {

If this works, please choose this comment as best answer!

Bhaswanthnaga vivek vutukuriBhaswanthnaga vivek vutukuri
Hope this helps:
<apex:page >
<apex:form >
 <audio id="audio" src="" autostart="false" ></audio>
<apex:actionsupport event = 'onchange' onsubmit = 'PlaySound()' />

​    <script>
    function PlaySound() {
          var sound = document.getElementById("audio");