SteveinAussie
May 2nd, 2003, 09:15 PM
Hello All,
I am a webmaster of a free article website and i want to add a javascript that allows users to click the new link of the day. But i dont want them to leave the page all i want is for that link to load a new page. I have included th script:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
//******************************************************
// * Script from http://ldpoint.com
// * Phone and internet services, tools*
// * You can use this code if you leave this message*
// ******************************************************
function GetTodaysURL()
{
var locationlist = new URLList
(
"http://javascript.internet.com/index.html", // Monday
"http://www.javascript.com", // Tuesday
"http://javascripts.com", //Wednesday
"http://javaboutique.internet.com", //Thursday
"http://www.theguestbook.com", //Friday
"http://www.thecounter.com", //Saturday
"http://wdvl.internet.com" // Sunday
);
now = new Date();
num = now.getDay();
if (num == 0) num = 7;
location.href = locationlist.list[num-1];
}
function URLList ()
{
var argv = URLList.arguments;
var argc = argv.length;
this.list = new Object();
for (var i = 0; i < argc; i++)
this.list[i] = argv[i];
this.count = argc;
return this;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
Example of the code, choosing <a href="javascript:GetTodaysURL()"> the page of
that day</a>. Tomorrow here will be shown another page.
<p><center>
</center>
<p>
</body>
</html>
########
Can someone show me how to change this script so that a new page will load if a visitors clicks on one of the daily links?
Any help would be appreciated.
I am a webmaster of a free article website and i want to add a javascript that allows users to click the new link of the day. But i dont want them to leave the page all i want is for that link to load a new page. I have included th script:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
//******************************************************
// * Script from http://ldpoint.com
// * Phone and internet services, tools*
// * You can use this code if you leave this message*
// ******************************************************
function GetTodaysURL()
{
var locationlist = new URLList
(
"http://javascript.internet.com/index.html", // Monday
"http://www.javascript.com", // Tuesday
"http://javascripts.com", //Wednesday
"http://javaboutique.internet.com", //Thursday
"http://www.theguestbook.com", //Friday
"http://www.thecounter.com", //Saturday
"http://wdvl.internet.com" // Sunday
);
now = new Date();
num = now.getDay();
if (num == 0) num = 7;
location.href = locationlist.list[num-1];
}
function URLList ()
{
var argv = URLList.arguments;
var argc = argv.length;
this.list = new Object();
for (var i = 0; i < argc; i++)
this.list[i] = argv[i];
this.count = argc;
return this;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
Example of the code, choosing <a href="javascript:GetTodaysURL()"> the page of
that day</a>. Tomorrow here will be shown another page.
<p><center>
</center>
<p>
</body>
</html>
########
Can someone show me how to change this script so that a new page will load if a visitors clicks on one of the daily links?
Any help would be appreciated.