Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-23-2002, 08:57 PM   PM User | #1
David Walker
New to the CF scene

 
Join Date: Jun 2002
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
David Walker is an unknown quantity at this point
Question 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
David Walker is offline   Reply With Quote
Old 06-24-2002, 01:03 AM   PM User | #2
ACJavascript
Regular Coder

 
Join Date: Jun 2002
Location: FL, USA
Posts: 734
Thanks: 0
Thanked 0 Times in 0 Posts
ACJavascript is on a distinguished road
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
ACJavascript is offline   Reply With Quote
Old 06-25-2002, 12:08 AM   PM User | #3
David Walker
New to the CF scene

 
Join Date: Jun 2002
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
David Walker is an unknown quantity at this point
Post 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
David Walker is offline   Reply With Quote
Old 06-25-2002, 03:08 AM   PM User | #4
ACJavascript
Regular Coder

 
Join Date: Jun 2002
Location: FL, USA
Posts: 734
Thanks: 0
Thanked 0 Times in 0 Posts
ACJavascript is on a distinguished road
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
ACJavascript is offline   Reply With Quote
Old 06-25-2002, 11:47 PM   PM User | #5
David Walker
New to the CF scene

 
Join Date: Jun 2002
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
David Walker is an unknown quantity at this point
thank you kindly ;-)
David Walker is offline   Reply With Quote
Old 06-26-2002, 08:20 AM   PM User | #6
whackaxe
Senior Coder

 
Join Date: Jun 2002
Location: paris, france
Posts: 1,216
Thanks: 0
Thanked 0 Times in 0 Posts
whackaxe is an unknown quantity at this point
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
whackaxe is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:43 AM.


Advertisement
Log in to turn off these ads.