...

View Full Version : reminder alarm



dips255
07-20-2012, 02:35 PM
Need help for an alarm to remind an event with sound

Philip M
07-20-2012, 06:08 PM
Need help for an alarm to remind an event with sound

Too vague (and too curt). How about "please"? I note you have 51 posts - but 0 thanks. :( But this ought to point you in the right direction. Sound is a big problem in HTML4 and the method used here is really only useful in IE and Firefox. The HTML5 <audio> tag is to be preferred but is only supported by the most modern browsers.



<span id ="message" style = "color:red";> </span>

<script type = "text/javascript">

var today = new Date();
var BigDay = new Date("July 20, 2012 17:00:00 UTC");
timeInSecs = parseInt((BigDay.getTime() - today.getTime())/1000);
if (timeInSecs <= 0 && timeInSecs >= -3600) { // show the message between chosen time and one hour afterwards
document.getElementById("message").innerHTML = "The time you wish to be reminded about has arrived";
self.location = "boom.wav"; // your sound file. This may pop up a separate window depending on plugins installed.
}

</script>

For IE ONLY you could place the following tag after the message <span>
<bgsound id="bgsound_id" loop=1 src="">
and in the script
document.all['bgsound_id'].src='boom.wav';


A man generally has two reasons for doing things - the one that sounds good, and the real one. - J.P.Morgan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum