如何使用javascript重定向页面网址

时间:2013-05-02 05:41:51

标签: javascript jquery browser

我想获得用户访问我的网页后页面的网址。假设用户刚进入我的网站页面xyz,现在他进入了浏览器栏上的另一个url abc。所以现在我想使用jquery或javascript获取abc的链接。有可能吗?

1 个答案:

答案 0 :(得分:1)

因为无法做到。新位置是私人/敏感信息。没有人希望您知道他们离开您的网站时访问了哪些网站。

How can i get the destination url in javascript onbeforeunload event?

但是如果你想在卸载之前做一些事情,你可以从下面的链接获得帮助。

jquery beforeunload does not display message

你得到了这个

的帮助
$(window).on('unload', function(){
});