Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

New Entry In DB Sound Alert

Options
  • 25-05-2006 2:38pm
    #1
    Registered Users Posts: 224 ✭✭


    Hi,

    I wonder is it possible to give a sound (be it mp3 or wav or whatever) everytime an new entry appears on a dynamic webpage. I currently have a help desk type page set up that refreshes every 30 seconds. Is it possible to have an audible alert when a new entry arrives???


Comments

  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    it certainly is possible with AJAX anyway because within gmail when you receive an instant message you get the same "bleep" sound as you get when you receive a instant message from the program. I wouldn't have a notion about AJAX myself though


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    A simple solution may be embedding the sound in the web page if a new item has appeared in the list, then set the sound to play once when the page has loaded.


  • Registered Users Posts: 224 ✭✭The Mighty Dubs


    seamus wrote:
    A simple solution may be embedding the sound in the web page if a new item has appeared in the list, then set the sound to play once when the page has loaded.

    I dont think that will work properly because when the page automatically refreshes every 30 seconds and I dont want the alert to be going off every 30 seconds only when a new entry is added...if you get my drift


  • Registered Users Posts: 683 ✭✭✭Gosh


    If it's a dynamic page then you would only include the sound play on "<body onLoad=" if you had new items in the list


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I dont think that will work properly because when the page automatically refreshes every 30 seconds and I dont want the alert to be going off every 30 seconds only when a new entry is added...if you get my drift
    What Gosh said. You only embed the sound if there is a new entry in the list.

    If you're wondering how to find out that there is a new entry in the list, then you're best to use cookies. You store a cookie on the machine that holds the date/time that the page was last loaded on that machine. If there are items that have been added after that date/time, then you embed the sound. If not, the sound doesn't get embedded. Then you reset the cookie to store the current date/time.

    That's just a simple way. There are better ways.


  • Advertisement
  • Registered Users Posts: 683 ✭✭✭Gosh


    Another method would be to throw up an alert on page load as follows
    <script type="text/javascript">
    function NewItems()
    {
    alert("There are new items on this page");
    }
    </script>
    
    <body onLoad="NewItems()">
    

    As said before only include the onLoad if you know there are new items. (In IE you get a sound as well when this box is displayed)


Advertisement