Difference between revisions of "Template:China Tongji Head"

Line 208: Line 208:
 
var keyWord = location.href.substring(39);
 
var keyWord = location.href.substring(39);
 
alert(keyWord);
 
alert(keyWord);
if(keyWord.indexOf("Project")>0){
+
if(keyWord.match("Project") != null){
 
document.getElementById("divProject").style.borderBottom = "4px solid #F0F";
 
document.getElementById("divProject").style.borderBottom = "4px solid #F0F";
}else if(keyWord.indexOf("Notebook")>0){
+
}else if(keyWord.match("Notebook") != null){
 
document.getElementById("divNotebook").style.borderBottom = "4px solid #F0F";
 
document.getElementById("divNotebook").style.borderBottom = "4px solid #F0F";
}else if(keyWord.indexOf("Achivement")>0){
+
}else if(keyWord.match("Achivement") != null){
 
document.getElementById("divAchivement").style.borderBottom = "4px solid #F0F";
 
document.getElementById("divAchivement").style.borderBottom = "4px solid #F0F";
}else if(keyWord.indexOf("Team")>0){
+
}else if(keyWord.match("Team" != null)){
 
document.getElementById("divTeam").style.borderBottom = "4px solid #F0F";
 
document.getElementById("divTeam").style.borderBottom = "4px solid #F0F";
}else if(keyWord.indexOf("Outreach")>0){
+
}else if(keyWord.match("Outreach") != null){
 
document.getElementById("divOutreach").style.borderBottom = "4px solid #F0F";
 
document.getElementById("divOutreach").style.borderBottom = "4px solid #F0F";
}else if(keyWord.indexOf("Safety")>0){
+
}else if(keyWord.match("Safety") != null){
 
document.getElementById("divSafety").style.borderBottom = "4px solid #F0F";
 
document.getElementById("divSafety").style.borderBottom = "4px solid #F0F";
 
}else{
 
}else{

Revision as of 11:52, 14 September 2015