我正在为我的网站使用JavaScript“倒计时然后重定向”脚本。我想使用类似HTTP引用在下面的脚本附:如何有条件地将引用链接重定向到不同的网页?
<script>
<!--
/*
Count down then redirect script
By JavaScript Kit (http://javascriptkit.com)
*/
//change below target URL to your own
var targetURL="www.domain.com";
//change the second to start counting down from
var countdownfrom=20;
var currentsecond = document.redirect.redirect2.value =
countdownfrom + 1;
function countredirect() {
if (currentsecond != 1) {
currentsecond -= 1;
document.redirect.redirect2.value = currentsecond
} else {
window.location = targetURL;
return;
}
setTimeout(countredirect, 1000);
}
countredirect();
//-->
</script>
我希望脚本一样工作:
如果有人从www.twitter.com到达时,它们将被重定向到www .domain.com/twitter.html倒数后。
如果有人从www.facebook.com抵达,他们将在倒计时后重定向到www.domain.com/facebook.html。
如果有人从www.youtube.com抵达,他们将在倒计时后重定向到www.domain.com/youtube.html。
我想重定向15-20 URL。请帮忙 !!我该怎么做 ??
我已经删除了自己[标签:JAVA]标签为你的问题似乎已经无关,与使用这种语言。 – 2015-02-24 19:18:38