
Jan 28th, 2008, 15:58
|
|
Reputable Member
|
|
Join Date: May 2007
Location: Margate
Age: 24
Posts: 156
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: Link to another page in JavaScript
- Code: Select all
<script>
//change the text below to reflect your own,
var before="Update required"
var current="Update is now required"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
if (difference==0)
document.write(current)
else if (difference>0)
document.write("Only "+difference+" days until "+before)
}
//enter the count down date using the format year/month/day
countdown(200,2,14)
</script> var before="Update required" (when Update required is shown it is a link to a another page)
var current="Update is now required" (when Update is now required is shown it is a link to a another page)
the above text to be links "update required" one link then when time runs out the "update is now required" required another link.
Does that make a little more sence
Last edited by R8515198; Jan 29th, 2008 at 07:24.
|