Search code examples
javascriptjqueryurlwindow

Jquery window.open get URL before close


Can anyone tell me, if its possible to get the URL of a window.open window, if i make a window.close and the person press the close button(window.close), how do i get the last url he was on? Right before it closed?


Solution

  • Have you tried using:

    var pathname = window.location.pathname; // This will get you the current url
    

    in your window.close method call.