读书人

javascript怎样获取window.history中记

发布时间: 2012-02-27 10:00:22 作者: rapoo

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()%> ";

读书人网 >asp.net

热点推荐