Why did my code stop working?

We want to conditionally display an element(s) based on button clicks on a Lightbox. This is to show different menus to people who choose different options on a disclaimer which pops up on first visit. We achieved this effect when the site was last published in October, but recently the code has stopped working. Now the menus do not appear at all, and the disclaimer shows up on every page.

Please Help and Many Thanks

Please post the URL of your site, and indicate where and how to show the problem.

dutchmedicalfood . com
When visitors click Yes on the lighbox, a menu box should appear. When they click No, a different menu box appears. At the moment, nothing appears regardless of choice.

@insidejobstudio I should first mention that the masterPage.js file has numerous errors (marked in red) that should be fixed before you can expect your site to work properly.

One thing you should do is to return the permission value from the Lightbox as a parameter in the Lightbox close . (Session storage does not work well with Lightboxes). Something like this:

wixWindow.lightbox.close({"permission", "disapproved"});

or

wixWindow.lightbox.close({"permission", "approved"});

@yisrael-wix
Hi Yisrael
Thank you for your response.
You’re right! Though we were not able to find any red lines in the masterPage code, I’ve attached below:

We understood that using session storage allows the visitors decision to persist for a certain amount of time, would this still be possible with the returned permission value?

Thanks again

@insidejobstudio The returned value would not be persistent, but from what I see in the code you don’t need it to be persistent. Though, if you want, you could save it upon return from the Lightbox.


Strange about not seeing any errors:

Since this is the masterPage.js, it will depend on what page you are on. Some pages might not have the page elements that are flagged.

The button enable() function does not take an argument which is why it’s marked as an error.