我需要獲得當前標題和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;
}
從哪裏和什麼時候獲得'標題頁'? –