ASP取得URL地址
1:通过Request 获取
http://localhost/QSS/default.aspx
Request.ApplicationPath: /QSS
Request.CurrentExecutionFilePath: /QSS/default.aspx
Request.FilePath: /QSS/default.aspx
Request.Path: /QSS/default.aspx
Request.RawUrl: /QSS/default.aspx 包括查询字符串(如果存在)。
Request.Url.AbsolutePath: /QSS/default.aspx
Request.Url.AbsoluteUri: http://localhost/QSS/default.aspx
Request.Url.Host: localhost
Request.Url.LocalPath: /QSS/default.aspx
Request.PhysicalApplicationPath: E:\WWW\QSS\
Request.PhysicalPath: E:\WWW\QSS\default.aspx
2、通过JS获取
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;
thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
tmpHPage = thisHREF.split( "/" );
thisHPage = tmpHPage[tmpHPage.length-1];
tmpUPage = thisURL.split( "/" );
thisUPage = tmpUPage[tmpUPage.length-1];

浙公网安备 33010602011771号