The result is the same (undefined). What I am really looking for is the Wix equivalent of window.onload and window.onbeforeunload. When leaving a page, the session,setItem(“page”, winLocation.url) function would be placed in the window,onbeforeunload event handler, Then. in the page that was just navigated to, the previousPageURL = session.getItem(“page”) function would be placed in the window,onload event handler.
Basically, you set the current url upon leaving any page, then retrieve this value upon entering any new page. But the wix-window api doesn’t have onload() or onbeforeunload() functions. Of course you could write code in every page setting and getting session variables, but I was hoping to get this working by writing the code once and putting it in the Site tab. But I can’t seem to get this to work,