Marcia Gulesian wrote on 30 jun 2004 in comp.lang.javascript
:
"Evertjan." wrote:
Marcia Gulesian wrote on 30 jun 2004 in comp.lang.javascript: > Is there a way to replace the URL value below, on the fly?
>
> <META HTTP-EQUIV="Refresh"
> CONTENT="3;URL=http://www.some.org/some.html">
What do you mean with "on the fly"?
Programatically.
And all this inside 3 seconds?
===================================
If you want to do it programmatically with clientside javascript, you
better use javascript all along:
<script type='text/javascript'>
myNewLocation = 'http://www.some.org/some.html'
setTimeout("location.href = myNewLocation",3000)
<script>
So what do you think of the above, Marcia?
Or do you want the user to press a button to change the destination
inside those 3 seconds?
Or depending on the time of day?
<script type='text/javascript'>
t = new Date()
myNewLocation = (t.hours()<12)
? 'http://www.some.org/morning.html'
: 'http://www.some.org/afternoon.html'
setTimeout("location.href = myNewLocation",3000)
<script>
But then why the 3 seconds waiting?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)