Refresh page using code

I have a menu in the header of my website.
On each click of a menu or submenu option I use the setItem and getItem to send data via session option of wix-storage.

The code for the above is in the masterpage.js as the menu is in the header and needs to be access on every page.

In the masterpage.js I use
wixLocation . to ( “/solutions” ); to navigate to the correct pages.

At the top of each separate page,before the OnReady function, I have the code to getItem. Inside the OnReady function, I have the code to perform an event based on the item retreived from the getitem.

It all works until the user clicks on, for example a solutions drop down option while the solutions page is the current page.

I’ve tried replacing
wixLocation . to ( “/solutions” );


wixLocation . to ( “https://www.domainname .com/solutions” );

but, at least in preview mode, this doesn’t work.

I’m sure there are various solutions.

The one I was thinking was using an if statement to check that if the current page NOT the one the user clicks on, then to compute the wixlocation comment, else just to stay on the page.

Can anyone offer any advice? Thanks