我需要获取当前标题并在 5 秒后重定向到:
http://mysite.org/redirect1.php?title=TITLE PAGE WHIT JAVASCRIPT
这是我的代码
if(country=="MX"){
url="http://mysite.org/redirect1.php?title=TITLE PAGE";
} else if (country == "ES") {
url="http://mysite.org/redirect2.php?title=TITLE PAGE";
} else if (country == "PE") {
url="http://mysite.org/redirect1.php?title=TITLE PAGE";
} else if (country == "AR") {
url="http://mysite.org/redirect3.php?title=TITLE PAGE";
} else if (country == "PY") {
url="http://mysite.org/redirect4.php?title=TITLE PAGE";
} else if (country == "CO") {
url="http://mysite.org/redirect1.php?title=TITLE PAGE";
} else if (country == "CL") {
url="http://mysite.org/redirect1.php?title=TITLE PAGE";
} else {
url="http://mysite.org/blank.htm";
}
setTimeout("location.href = url;",5000);
我认为是这样的:
var title = document.title;
if(country=="MX"){
url="http://mysite.org/redirect1.php?title"+title;
}