How to get previous page url using jquery

前端 未结 9 1270
独厮守ぢ
独厮守ぢ 2020-12-02 18:40

How to get the previous page url using jquery?

I am using the following code to get the current page location

$(document).ready(function() {
var path         


        
9条回答
  •  自闭症患者
    2020-12-02 18:58

    We have document.referrer for this, but it is not on which we can relay. This could be saved, could be not

    $(document).ready(function() {
       var referrer =  document.referrer;
    });
    

    The better approach is to add a cookie to store the previous-url in the browser.

提交回复
热议问题