当前位置: 代码迷 >> ASP.NET >> javascript怎样获取window.history中记录的多个URL?解决办法
  详细解决方案

javascript怎样获取window.history中记录的多个URL?解决办法

热度:980   发布时间:2013-02-25 00:00:00.0
javascript怎样获取window.history中记录的多个URL?
如题

------解决方案--------------------------------------------------------
window.history(-1);
window.history(-2);
window.history(1);
.....
------解决方案--------------------------------------------------------
微软的答复
For security reasons, the history object does not expose the actual URLs in the browser history.

你可以用
document.referrer
取得上一个地址
或者history.go back 之类的
------解决方案--------------------------------------------------------
后台: if (!this.IsPostBack) { ViewState[ "url "] = Request.UrlReferrer.ToString(); }
------解决方案--------------------------------------------------------
视图到js.就很容易了var url = " <%=ViewState[ "url "].ToString()%> ";
  相关解决方案