如何使用javascript从变量中获取基本URL

时间:2013-04-07 00:17:04

标签: javascript html

在这个脚本中,我想将baseURLStatic定义为http //:%ALLHOST%

document.write("<li id='tab"+x+"' onclick='window.location.assign(\""+baseURLStatic+"/"+year+"/home/"+league_id+"#"+x+"\")'>"+mimicHomePageTabs[x]+"</li>\n");

我试过这个,但没有用

document.write("<li id='tab"+x+"' onclick='window.location.assign(\""+http+"//:"+%ALLHOST%+"/"+year+"/home/"+league_id+"#"+x+"\")'>"+mimicHomePageTabs[x]+"</li>\n");

网址的最终结果是

http://%ALLHOST%/%YEAR%/home/%LEAGUEID%

0 个答案:

没有答案
相关问题