使用javascript分析IIS托管站点的url
我在IIS7.5中托管一个web应用程序,需要解析url,以便在应用程序名称之后给出url的一部分。例如,如果托管的应用程序名称是使用javascript分析IIS托管站点的url,javascript,iis-7.5,Javascript,Iis 7.5,我在IIS7.5中托管一个web应用程序,需要解析url,以便在应用程序名称之后给出url的一部分。例如,如果托管的应用程序名称是testproject,并且输入的url是http://localhost/testproject/temp/index.html我需要提取url的/temp/index.html部分。有什么方法可以做到这一点吗?我尝试使用javascript,您需要使用该对象 尝试window.location.pathname.replace('/testproject','')
testproject
,并且输入的url是http://localhost/testproject/temp/index.html
我需要提取url的/temp/index.html
部分。有什么方法可以做到这一点吗?我尝试使用javascript,您需要使用该对象
尝试window.location.pathname.replace('/testproject','')代码>