how to get a base url from a variable with javascript

dazed

New Member
This is a bit tricky for me , here is a script i use to pull the base url\[code\]// ADD HOME PAGE TABS TO REPORTSvar mimicHomePageTabs = new Array();mimicHomePageTabs[0]="Home";mimicHomePageTabs[1]="Managers";mimicHomePageTabs[2]="Standings";mimicHomePageTabs[3]="Game Day";mimicHomePageTabs[4]="History";mimicHomePageTabs[5]="News";mimicHomePageTabs[6]="Draft";mimicHomePageTabs[7]="Playoffs";mimicHomePageTabs[8]="Calendar";if(!document.getElementById("body_home")||(document.getElementById("body_home")&&location.href.indexOf("MODULE=MESSAGE")!=-1)) { document.write("<div id='homepagetabsdiv'><ul id='homepagetabs'>\n"); for(var x=0; x<mimicHomePageTabs.length;x++) { document.write("<li id='tab"+x+"' onclick='window.location.assign(\""+baseURLStatic+"/"+year+"/home/"+league_id+"#"+x+"\")'>"+mimicHomePageTabs[x]+"</li>\n"); } document.write("</ul></div>\n");}\[/code\]Now here is the tricky part....the website has a staticurl of wwwx and a dynamic url of footballx , each new year the site updates , and the staticurl must always be used , however, the previous years version of the website only uses the dynamic url. So there is a variance that works for both the new year site and old year site called %ALLHOST% , this variable is what i need to set as my base url , but i only know how to edit the above script for dynamic or static , so how/or is it possible to introduce the %ALLHOST% variable as the baseurl ?Hope this makes sense, as i'm confusing myself even ;)so something like this is what i was wanting, but correctly formatted ofc as i dont know what to do here\[code\](\""+baseURL%ALLHOST%+"/"+year+"/home/"+league_id+"#"+x+"\")\[/code\]
 
Back
Top