Hello
I am trying to write some code in javascript to open a link at a certain time and then close it later. I have no trouble getting the link to open when the desired time is set. The problem is getting the 'link' to close as the link launches real player (to play a radio station) and so I was wondering if anyone can tell me if there is a way to close real player from the same script in the html page. If not can I use another scripting/programming language or are there any freeware programs that will end programs/applications on a timer.
The code I have already is -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=Javascript><!--
function Clock(){
var today = new Date(); // Get current time.
var d = today.getDay(); // Extract Day.
var h = today.getHours(); // Extract hours.
var m = today.getMinutes(); // Extract minutes.
var s = today.getSeconds(); // Extract seconds.
if (m < 10) m = "0" + m; // Convert 0 minutes to 00 minutes, etc.
if (s < 10) s = "0" + s; // Convert 0 seconds to 00 seconds, etc.
var t = h+ ':' +m+ ':' +s+ ' '; // Put it all together.
document.clock.time.value = t ; // Display it in a text box.
// Arrange to do it all again in 1 sec
setTimeout("Clock()", 1000); // 1000 ms is 1 second.
{
if (h == 21 & m == 29 & s == 00)
window.location=" }
{ if (h == 21 & m == 29 & s == 15)
close.window(realplay.exe); ???? IT IS THIS LINE THAT IS THE PROBLEM
}
}
//--></SCRIPT>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff onload=Clock() ?><BR><BR>
<FORM name=clock><INPUT size=10 name=time></FORM></BODY></HTML>
Thanks in advance
Greg
I am trying to write some code in javascript to open a link at a certain time and then close it later. I have no trouble getting the link to open when the desired time is set. The problem is getting the 'link' to close as the link launches real player (to play a radio station) and so I was wondering if anyone can tell me if there is a way to close real player from the same script in the html page. If not can I use another scripting/programming language or are there any freeware programs that will end programs/applications on a timer.
The code I have already is -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=Javascript><!--
function Clock(){
var today = new Date(); // Get current time.
var d = today.getDay(); // Extract Day.
var h = today.getHours(); // Extract hours.
var m = today.getMinutes(); // Extract minutes.
var s = today.getSeconds(); // Extract seconds.
if (m < 10) m = "0" + m; // Convert 0 minutes to 00 minutes, etc.
if (s < 10) s = "0" + s; // Convert 0 seconds to 00 seconds, etc.
var t = h+ ':' +m+ ':' +s+ ' '; // Put it all together.
document.clock.time.value = t ; // Display it in a text box.
// Arrange to do it all again in 1 sec
setTimeout("Clock()", 1000); // 1000 ms is 1 second.
{
if (h == 21 & m == 29 & s == 00)
window.location=" }
{ if (h == 21 & m == 29 & s == 15)
close.window(realplay.exe); ???? IT IS THIS LINE THAT IS THE PROBLEM
}
}
//--></SCRIPT>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff onload=Clock() ?><BR><BR>
<FORM name=clock><INPUT size=10 name=time></FORM></BODY></HTML>
Thanks in advance
Greg