Web Analytics Made Easy -
StatCounter alerts with sound - CodingForum

Announcement

Collapse
No announcement yet.

alerts with sound

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • alerts with sound

    Hello All - a newbie question, how do you add sound to an alert box. Ex. an alert box pops up and goes,"ding".

    thanks in advance
    DW

  • #2
    you cannot put a sound to an alert. The alert sound - is what the user specifies on there computer. You can though make a function that plays a sound when the user hits okay on an alert.
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

    Comment


    • #3
      alert sound cont.

      Thanks AC!

      Is there a way to write a whole new function that includes sound and some popup window for the alert?

      DW

      Comment


      • #4
        Sure no problem here it is.

        FOR IT TO WORK YOU NEED a SOUND IN THE EMBED!!!

        ----------


        <script langauge="javascript">

        var popup="http://www.yahoo.com"
        var alertMessage="This is an alert hehehe"

        function userAlert(){

        alert(alertMessage)
        document.jukebox.play()
        window.open(popup,"def")

        }
        </script>


        <a href="javascript:userAlert();">Click Here</a>

        <embed src='SoundURLHere' autostart='true' hidden='true' loop='true' name="jukebox">

        ------------

        The popurl=The page you want to popup
        The alertMessage=What you want the alert to say
        The SoundURLHere=The Directory to the sound

        Hope this works for ya
        CYWebmaster.com - See why we dot com!!
        ACJavascripts.com - Cut & Paste Javascripts!
        SimplyProgram.com - Personal Blog

        Comment


        • #5
          thank you kindly ;-)

          Comment


          • #6
            there is also the possibility of using vbscript to pop up different types of alert boxes but i dont know if you can then interact with javascript.
            photoshop too expensive? use the GIMP! www.gimp.org

            Comment

            Working...
            X