Forum Moderators: open
I've tried a few ways I came up with but with no success. I'm the first to admit that I suck at javascript lol.
Many thanks
Considering that you're using PHP - you could always build the html meta tag that does a redirect <meta http-equiv="refresh" etc) (but then you said you wanted to avoid the meta tag...)
Why does it have to be JS?
Cheers.
setTimeout("document.location = <?=$destination?>", 5000);
- setTimeout evaluates an expression or calls a function once after a specified number of
milliseconds elapses.
- If you assign a string to the location property of an object, JavaScript creates a
location object and assigns that string to its href property. For example, the
following two statements are equivalent and set the URL of the current window
to the Netscape home page:
window.location.href="http://home.netscape.com/"
window.location="http://home.netscape.com/"
(I'm not really sure if the PHP code is placed correctly, so you may have to tweak this)